public static AMapPattern newAMapPattern(ILexLocation location, List<AMapletPatternMaplet> maplets) { AMapPattern result = new AMapPattern(); initPattern(result, location); result.setMaplets(maplets); return result; }
/** * Returns a deep clone of this {@link AMapPattern} node. * @return a deep clone of this {@link AMapPattern} node */ public AMapPattern clone() { return new AMapPattern( _location, cloneList(_definitions), _resolved, cloneList(_maplets) ); }
/** * Creates a deep clone of this {@link AMapPattern} 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 AMapPattern} node */ public AMapPattern clone(Map<INode,INode> oldToNewMap) { AMapPattern node = new AMapPattern( _location, cloneList(_definitions, oldToNewMap), _resolved, cloneList(_maplets, oldToNewMap) ); oldToNewMap.put(this, node); return node; }