/** * Creates a deep clone of this {@link AObjectPattern} 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 AObjectPattern} node */ public AObjectPattern clone(Map<INode,INode> oldToNewMap) { AObjectPattern node = new AObjectPattern( _location, cloneList(_definitions, oldToNewMap), _resolved, cloneNode(_classname, oldToNewMap), cloneList(_fields, oldToNewMap), _type ); oldToNewMap.put(this, node); return node; }
/** * Returns a deep clone of this {@link AObjectPattern} node. * @return a deep clone of this {@link AObjectPattern} node */ public AObjectPattern clone() { return new AObjectPattern( _location, cloneList(_definitions), _resolved, cloneNode(_classname), cloneList(_fields), _type ); }
public static AObjectPattern newAObjectPattern(ILexNameToken classname, List<ANamePatternPair> list) { AObjectPattern result = new AObjectPattern(); initPattern(result, classname.getLocation()); result.setFields(list); result.setClassname(classname); result.setType(AstFactory.getAUnresolvedType(classname)); return result; }