當前位置: 首頁>>代碼示例>>Java>>正文


Java FeatureVariable類代碼示例

本文整理匯總了Java中fr.familiar.variable.FeatureVariable的典型用法代碼示例。如果您正苦於以下問題:Java FeatureVariable類的具體用法?Java FeatureVariable怎麽用?Java FeatureVariable使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


FeatureVariable類屬於fr.familiar.variable包,在下文中一共展示了FeatureVariable類的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: gets

import fr.familiar.variable.FeatureVariable; //導入依賴的package包/類
/**
 * @param ft
 * @param strConfs
 * @param fmvJhipster
 * @return values of "ft" in the configuration... (typically OR-groups)
 */
private String[] gets(String ft, Set<String> strConfs,
		FeatureModelVariable fmvJhipster) {
	
	ArrayList<String> strs = new ArrayList<String>();
	 SetVariable chs = fmvJhipster.getFeature(ft).children();
	 for (Variable ch : chs.getVars()) {
		FeatureVariable ftv = (FeatureVariable) ch; 
		String ftName = ftv.getFtName();
		if (strConfs.contains(ftName))
			strs.add(toRealFtName2(ftName));
	}
	String[] r = new String[strs.size()];
	return (String[]) strs.toArray(r); 
	 
}
 
開發者ID:axel-halin,項目名稱:Thesis-JHipster,代碼行數:22,代碼來源:JHipsterTest.java

示例2: get

import fr.familiar.variable.FeatureVariable; //導入依賴的package包/類
/**
 * @param ft
 * @param strConfs
 * @param fmvJhipster
 * @return value of "ft" in the configuration... otherwise false
 */
private String get(String ft, Set<String> strConfs, FeatureModelVariable fmvJhipster) {
	SetVariable chs = fmvJhipster.getFeature(ft).children();
	 for (Variable ch : chs.getVars()) {
		FeatureVariable ftv = (FeatureVariable) ch;
		String ftName = ftv.getFtName();
		if (strConfs.contains(ftName))
			return toRealFtName2(ftName);
	}
	return "false"; // "no" sometimes
}
 
開發者ID:axel-halin,項目名稱:Thesis-JHipster,代碼行數:17,代碼來源:JHipsterTest.java

示例3: extractFeatures

import fr.familiar.variable.FeatureVariable; //導入依賴的package包/類
/**
 * Extract the features of a specific configuration and return them in an Set of String.
 * 
 * @param configuration JHipster's configuration to work on.
 * @return All features of configuration in a Set of String.
 */
private Set<String> extractFeatures(Variable configuration){
	SetVariable svconf = (SetVariable) configuration;
	Set<Variable> fts = svconf.getVars();
	Set<String> strConfs = new HashSet<String>();
	for (Variable ft : fts) {
		FeatureVariable ftv = (FeatureVariable) ft;
		strConfs.add(ftv.getFtName());
	}
	return strConfs;
}
 
開發者ID:axel-halin,項目名稱:Thesis-JHipster,代碼行數:17,代碼來源:JHipsterTest.java

示例4: getNumberOfSuitableWidgets

import fr.familiar.variable.FeatureVariable; //導入依賴的package包/類
public int getNumberOfSuitableWidgets() throws BadIDException {
    try {
        FeatureVariable f_var = pilot.getFVariable(fmID +".Name");
        return f_var.children().getVars().size();
    } catch (VariableNotExistingException | VariableAmbigousConflictException e) {
        throw new BadIDException("The fmID " + fmID + " appears to be incorrect.");
    }
}
 
開發者ID:ace-design,項目名稱:sensor-data-compo-visu,代碼行數:9,代碼來源:Universe.java

示例5: getLastWidgetName

import fr.familiar.variable.FeatureVariable; //導入依賴的package包/類
public String getLastWidgetName() throws GetUniqueElementOnNonCompleteConfiguration, BadIDException {
    FeatureVariable f_var;
    try{
        f_var = pilot.getFVariable(fmID +".Name");
    } catch (VariableNotExistingException | VariableAmbigousConflictException e) {
        throw new BadIDException("The fmID " + fmID + " appears to be incorrect.");
    }
    if(f_var.children().getVars().size()==1){
        Variable[] varSet = new Variable[]{};
        Variable v = f_var.children().getVars().toArray(varSet)[0];
        return v.getValue();
    }
    else throw new GetUniqueElementOnNonCompleteConfiguration("Reduction "+ fmID +" appears not to be complete.");
}
 
開發者ID:ace-design,項目名稱:sensor-data-compo-visu,代碼行數:15,代碼來源:Universe.java

示例6: getWidgetsNames

import fr.familiar.variable.FeatureVariable; //導入依賴的package包/類
public List<String> getWidgetsNames() throws BadIDException {
    List<String> res = new ArrayList<>();
    FeatureVariable f_var;
    try{
        f_var = pilot.getFVariable(fmID +".Name");
    } catch (VariableNotExistingException | VariableAmbigousConflictException e) {
        throw new BadIDException("The fmID " + this.fmID + " appears to be incorrect.");
    }
    for(Variable v : f_var.children().getVars()){
        FeatureVariable fv = (FeatureVariable) v;
        res.add(fv.getFtName());
    }
    return res;
}
 
開發者ID:ace-design,項目名稱:sensor-data-compo-visu,代碼行數:15,代碼來源:Universe.java

示例7: getLastLibraryName

import fr.familiar.variable.FeatureVariable; //導入依賴的package包/類
public String getLastLibraryName() throws GetUniqueElementOnNonCompleteConfiguration, BadIDException {
    FeatureVariable f_var;
    try{
        f_var = pilot.getFVariable(fmID +".Library");
    } catch (VariableNotExistingException | VariableAmbigousConflictException e) {
        throw new BadIDException("The fmID " + this.fmID + " appears to be incorrect.");
    }
    if(f_var.children().getVars().size()==1){
        Variable[] varSet = new Variable[]{};
        Variable v = f_var.children().getVars().toArray(varSet)[0];
        return v.getValue();
    }
    else throw new GetUniqueElementOnNonCompleteConfiguration("Reduction "+ fmID +" appears not to be complete.");
}
 
開發者ID:ace-design,項目名稱:sensor-data-compo-visu,代碼行數:15,代碼來源:Universe.java

示例8: getLibrariesNames

import fr.familiar.variable.FeatureVariable; //導入依賴的package包/類
public List<String> getLibrariesNames() throws GetUniqueElementOnNonCompleteConfiguration, BadIDException {
    List<String> res = new ArrayList<>();
    FeatureVariable f_var;
    try{
        f_var = pilot.getFVariable(fmID +".Library");
    } catch (VariableNotExistingException | VariableAmbigousConflictException e) {
        throw new BadIDException("The fmID " + this.fmID + " appears to be incorrect.");
    }
    for(Variable v : f_var.children().getVars())
        res.add(v.getIdentifier());
    return res;
}
 
開發者ID:ace-design,項目名稱:sensor-data-compo-visu,代碼行數:13,代碼來源:Universe.java

示例9: Widget

import fr.familiar.variable.FeatureVariable; //導入依賴的package包/類
public Widget(String formula) throws UnhandledFamiliarException {
    this.formula=formula;
    FeatureVariable f_var;
    try {
        widgetID = pilot.declareFM(formula);
        f_var = pilot.getFVariable(widgetID +".Name");
    } catch (FMEngineException | VariableNotExistingException | VariableAmbigousConflictException e) {
        throw new UnhandledFamiliarException("Failing declaration of a widget feature model.");
    }
    name = f_var.children().getVars().toArray(new Variable[]{})[0].getValue();
}
 
開發者ID:ace-design,項目名稱:sensor-data-compo-visu,代碼行數:12,代碼來源:Widget.java

示例10: outputCombination

import fr.familiar.variable.FeatureVariable; //導入依賴的package包/類
private static String outputCombination(List<SetVariable> combinaison) {
	String log = "";
	for (SetVariable sv : combinaison) {
		log += "{";
		for (Variable v : sv.getVars()) {
			FeatureVariable fv = (FeatureVariable)v;
			log += fv.getFtName()+" ";
		}
		log += "}\n";
	}
	return log;
}
 
開發者ID:surli,項目名稱:spinefm,代碼行數:13,代碼來源:App.java

示例11: createOrGetFeature

import fr.familiar.variable.FeatureVariable; //導入依賴的package包/類
private Feature createOrGetFeature(FeatureModel fm, FeatureVariable fvar) {
	Feature result;
	if (features.containsKey(fvar.name()))
		result = features.get(fvar.name());
	else {
		result = FMModelFactory.eINSTANCE.createFeature();
		result.setId(fm.getId()+"."+fvar.name());
		result.setName(fvar.name());
		features.put(fvar.name(),result);
	}
	return result;
}
 
開發者ID:surli,項目名稱:spinefm,代碼行數:13,代碼來源:FMLSpineFMAdapter.java

示例12: createFeaturesFromFamiliarRoot

import fr.familiar.variable.FeatureVariable; //導入依賴的package包/類
private void createFeaturesFromFamiliarRoot(FeatureModel fm, FeatureModelVariable fmv, FeatureVariable fv, Feature f) {
	Set<Variable> sv = fv.children().getVars();

	for (Variable v : sv) {
		if (v.getType().equals("FEATURE")) {
			FeatureVariable fv2 = (FeatureVariable)v;
			Feature sfv = this.createOrGetFeature(fm,fv2);
			Group group;
			if (sourceGroup.containsKey(sfv)) {
				group = sourceGroup.get(sfv);
				if (!addedGroup.get(group)) {
					f.getChildren().add(group);
					addedGroup.put(group, true);
				}
			} else {
				group = FMModelFactory.eINSTANCE.createGroup();
				VariabilityOperatorVariable vop = fmv.getVOP(fv2.getFtName());
				group.setState(this.getGroupStateFromVOP(vop));
				group.getFeatures().add(sfv);
				f.getChildren().add(group);
			}
			fm.addFeature(sfv.getName(), sfv, group.getState());
			//groot.addFeature(sfv);
			this.createFeaturesFromFamiliarRoot(fm, fmv, fv2, sfv);
		}
	}
	//f.addGroup(groot);
}
 
開發者ID:surli,項目名稱:spinefm,代碼行數:29,代碼來源:FMLSpineFMAdapter.java


注:本文中的fr.familiar.variable.FeatureVariable類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。