本文整理匯總了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);
}
示例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
}
示例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;
}
示例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.");
}
}
示例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.");
}
示例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;
}
示例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.");
}
示例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;
}
示例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();
}
示例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;
}
示例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;
}
示例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);
}