本文整理汇总了Java中net.ssehub.easy.varModel.model.Project.getAttributesCount方法的典型用法代码示例。如果您正苦于以下问题:Java Project.getAttributesCount方法的具体用法?Java Project.getAttributesCount怎么用?Java Project.getAttributesCount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.ssehub.easy.varModel.model.Project
的用法示例。
在下文中一共展示了Project.getAttributesCount方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initializeAttributes
import net.ssehub.easy.varModel.model.Project; //导入方法依赖的package包/类
@Override
protected void initializeAttributes() {
// this is not optimal if a configuration is used directly for projection but ok for now
// (re) initializes self and leaves parent untouched where instances may be reused
if (null == attributes) {
Project project = configuration.getProject();
List<Attribute> tmp = new ArrayList<Attribute>();
for (int a = 0; a < project.getAttributesCount(); a++) {
IDecisionVariable var = configuration.getDecision(project.getAttribute(a));
if (null != var && filter.isEnabled(var)) {
Attribute attr = new Attribute(this, var, filter);
tmp.add(attr);
nameMap.put(attr.getQualifiedName(), attr);
}
}
attributes = new Attribute[tmp.size()];
tmp.toArray(attributes);
}
}
示例2: getBindingTimeAnnotation
import net.ssehub.easy.varModel.model.Project; //导入方法依赖的package包/类
/**
* Returns the binding time annotation of the project to create the selector statement of the freeze block.
* @param project The project for which the freeze block shall be created.
* @return The binding time annotation or <tt>null</tt> it could not be found.
*/
private Attribute getBindingTimeAnnotation(Project project) {
Attribute btAnnotation = project.getAttribute(QmConstants.ANNOTATION_BINDING_TIME);
// Try to build up the cache
if (null == btAnnotation && project.getName().endsWith(QmConstants.CFG_POSTFIX)) {
String baseName = project.getName().substring(0, project.getName().length()
- QmConstants.CFG_POSTFIX.length());
Project baseProject = usedProjects.get(baseName);
if (null == baseProject) {
for (int i = 0, end = project.getImportsCount(); i < end && null == baseProject; i++) {
Project importedProject = project.getImport(i).getResolved();
String importedName = importedProject.getName();
if (!usedProjects.containsKey(importedName)) {
usedProjects.put(importedName, importedProject);
}
if (baseName.equals(importedName)) {
baseProject = importedProject;
}
}
}
if (null != baseProject) {
for (int i = 0, end = baseProject.getAttributesCount(); i < end && btAnnotation == null; i++) {
btAnnotation = baseProject.getAttribute(QmConstants.ANNOTATION_BINDING_TIME);
}
}
}
return btAnnotation;
}
示例3: getAttributeDeclaration
import net.ssehub.easy.varModel.model.Project; //导入方法依赖的package包/类
/**
* Returns a matching attribute declaration.
*
* @param configuration the configuration to return the declaration for
* @param name the name of the attribute to be returned
* @return the attribute declaration or <b>null</b> if not found
*/
public static IvmlDeclaration getAttributeDeclaration(Configuration configuration, String name) {
IvmlDeclaration result = null;
Project project = configuration.getConfiguration().getProject();
for (int a = 0; null == result && a < project.getAttributesCount(); a++) {
AbstractVariable var = project.getAttribute(a);
if (var.getName().equals(name) || var.getQualifiedName().equals(name)) {
result = new IvmlDeclaration(var);
}
}
return result;
}
示例4: getBindingTimeAnnotation
import net.ssehub.easy.varModel.model.Project; //导入方法依赖的package包/类
/**
* Returns the binding time annotation of the project to create the selector statement of the freeze block.
* @param project The project for which the freeze block shall be created.
* @return The binding time annotation or <tt>null</tt> it could not be found.
*/
private Attribute getBindingTimeAnnotation(Project project) {
Attribute btAnnotation = project.getAttribute(ANNOTATION_BINDING_TIME);
// Try to build up the cache
if (null == btAnnotation && project.getName().endsWith(CFG_POSTFIX)) {
String baseName = project.getName().substring(0, project.getName().length() - CFG_POSTFIX.length());
Project baseProject = usedProjects.get(baseName);
if (null == baseProject) {
for (int i = 0, end = project.getImportsCount(); i < end && null == baseProject; i++) {
Project importedProject = project.getImport(i).getResolved();
String importedName = importedProject.getName();
if (!usedProjects.containsKey(importedName)) {
usedProjects.put(importedName, importedProject);
}
if (baseName.equals(importedName)) {
baseProject = importedProject;
}
}
}
if (null != baseProject) {
for (int i = 0, end = baseProject.getAttributesCount(); i < end && btAnnotation == null; i++) {
btAnnotation = baseProject.getAttribute(ANNOTATION_BINDING_TIME);
}
}
}
return btAnnotation;
}