/** * Returns a deep clone of this {@link AOptionalType} node. * @return a deep clone of this {@link AOptionalType} node */ public AOptionalType clone() { return new AOptionalType( _location, _resolved, _definitions, _type ); }
/** * Creates a deep clone of this {@link AOptionalType} node while putting all * old node-new node relations in the map {@code oldToNewMap}. * @param oldToNewMap the map filled with the old node-new node relation * @return a deep clone of this {@link AOptionalType} node */ public AOptionalType clone(Map<INode,INode> oldToNewMap) { AOptionalType node = new AOptionalType( _location, _resolved, _definitions, _type ); oldToNewMap.put(this, node); return node; }
public static AOptionalType newAOptionalType(ILexLocation location, PType type) { AOptionalType result = new AOptionalType(); initType(result, location); while (type instanceof AOptionalType) { type = ((AOptionalType) type).getType(); } result.setType(type); return result; }