本文整理匯總了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;
}