/** * Method that has to create a deep copy of the model, without * sharing any of existing Objects. */ public ModelNode cloneModel() { return new StarModel(mModel.cloneModel()); }
public ModelNode rewrite() { /* First, need to create a tree of sub-models, consisting of * binary concat nodes (as opposed to n-ary list). Can do that * recursively (note that we'll always have at least 2 child * nodes!) */ ModelNode model = rewrite(mContentSpecs, 0, mContentSpecs.length); // and then resolve arity modifiers, if necessary: if (mArity == '*') { return new StarModel(model); } if (mArity == '?') { return new OptionalModel(model); } if (mArity == '+') { return new ConcatModel(model, new StarModel(model.cloneModel())); } return model; }
public ModelNode rewrite() { // First, need to convert sub-specs: ContentSpec[] specs = mContentSpecs; int len = specs.length; ModelNode[] models = new ModelNode[len]; for (int i = 0; i < len; ++i) { models[i] = specs[i].rewrite(); } ChoiceModel model = new ChoiceModel(models); // and then resolve arity modifiers, if necessary: if (mArity == '*') { return new StarModel(model); } if (mArity == '?') { return new OptionalModel(model); } if (mArity == '+') { return new ConcatModel(model, new StarModel(model.cloneModel())); } return model; }
/** * Method that has to create a deep copy of the model, without * sharing any of existing Objects. */ public ModelNode cloneModel() { return new StarModel(mModel.cloneModel()); }
/** * Method that has to create a deep copy of the model, without * sharing any of existing Objects. */ public ModelNode cloneModel() { return new StarModel(mModel.cloneModel()); }
/** * Method that has to create a deep copy of the model, without * sharing any of existing Objects. */ public ModelNode cloneModel() { return new StarModel(mModel.cloneModel()); }
/** * Method that has to create a deep copy of the model, without * sharing any of existing Objects. */ public ModelNode cloneModel() { return new StarModel(mModel.cloneModel()); }
/** * Method that has to create a deep copy of the model, without * sharing any of existing Objects. */ @Override public ModelNode cloneModel() { return new StarModel(mModel.cloneModel()); }
/** * Method that has to create a deep copy of the model, without * sharing any of existing Objects. */ @Override public ModelNode cloneModel() { return new StarModel(mModel.cloneModel()); }
/** * Method that has to create a deep copy of the model, without * sharing any of existing Objects. */ @Override public ModelNode cloneModel() { return new StarModel(mModel.cloneModel()); }
public ModelNode rewrite() { /* First, need to create a tree of sub-models, consisting of * binary concat nodes (as opposed to n-ary list). Can do that * recursively (note that we'll always have at least 2 child * nodes!) */ ModelNode model = rewrite(mContentSpecs, 0, mContentSpecs.length); // and then resolve arity modifiers, if necessary: if (mArity == '*') { return new StarModel(model); } if (mArity == '?') { return new OptionalModel(model); } if (mArity == '+') { return new ConcatModel(model, new StarModel(model.cloneModel())); } return model; }
public ModelNode rewrite() { /* First, need to create a tree of sub-models, consisting of * binary concat nodes (as opposed to n-ary list). Can do that * recursively (note that we'll always have at least 2 child * nodes!) */ ModelNode model = rewrite(mContentSpecs, 0, mContentSpecs.length); // and then resolve arity modifiers, if necessary: if (mArity == '*') { return new StarModel(model); } if (mArity == '?') { return new OptionalModel(model); } if (mArity == '+') { return new ConcatModel(model, new StarModel(model.cloneModel())); } return model; }
@Override public ModelNode rewrite() { TokenModel model = new TokenModel(mElemName); if (mArity == '*') { return new StarModel(model); } if (mArity == '?') { return new OptionalModel(model); } if (mArity == '+') { return new ConcatModel(model, new StarModel(new TokenModel(mElemName))); } return model; }
@Override public ModelNode rewrite() { TokenModel model = new TokenModel(mElemName); if (mArity == '*') { return new StarModel(model); } if (mArity == '?') { return new OptionalModel(model); } if (mArity == '+') { return new ConcatModel(model, new StarModel(new TokenModel(mElemName))); } return model; }
@Override public ModelNode rewrite() { TokenModel model = new TokenModel(mElemName); if (mArity == '*') { return new StarModel(model); } if (mArity == '?') { return new OptionalModel(model); } if (mArity == '+') { return new ConcatModel(model, new StarModel(new TokenModel(mElemName))); } return model; }