/** * Returns the source file's {@link Vector} list. * * @return The {@link Vector} list. */ public List<Vector> getVectors() { List<Vector> vectors = new ArrayList<>(); for (CodeFragment cf : codeFragments_) { vectors.add(cf.getVector()); } return vectors; }
@Override public AstNode code(String code) { CodeFragment c = new CodeFragment(); c.setCode(code); return c; }
/** * Adds a {@link CodeFragment} to the source file's code fragments list. * * @param codeFragment The {@link CodeFragment} to be added. * @return True if the insertion was successful, otherwise false. */ public boolean addCodeFragment(CodeFragment codeFragment) { codeFragment.setSourceFile(this); return codeFragments_.add(codeFragment); }