当前位置: 首页>>代码示例>>Java>>正文


Java Project.getAttributesCount方法代码示例

本文整理汇总了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);
    }
}
 
开发者ID:SSEHUB,项目名称:EASyProducer,代码行数:20,代码来源:Configuration.java

示例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;
}
 
开发者ID:QualiMaster,项目名称:QM-EASyProducer,代码行数:38,代码来源:ProjectFreezeModifier.java

示例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;
}
 
开发者ID:SSEHUB,项目名称:EASyProducer,代码行数:19,代码来源:Utils.java

示例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;
}
 
开发者ID:SSEHUB,项目名称:EASyProducer,代码行数:37,代码来源:DynamicFreezeTest.java


注:本文中的net.ssehub.easy.varModel.model.Project.getAttributesCount方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。