@Test public final void testCopyTString() { BioPAXFactory factory = BioPAXLevel.L3.getDefaultFactory(); Protein p1 = factory.create(Protein.class, "p1"); ProteinReference pr1 = factory.create(ProteinReference.class, "pr1"); UnificationXref x1 = factory.create(UnificationXref.class, "x1"); UnificationXref x2 = factory.create(UnificationXref.class, "x2"); p1.setEntityReference(pr1); p1.setDisplayName("p1"); pr1.addXref(x1); pr1.addXref(x2); pr1.setDisplayName("pr1"); x1.setId("1"); x1.setDb("geneid"); x2.setId("2"); x2.setDb("geneid"); assertEquals(pr1, p1.getEntityReference()); assertEquals(2, p1.getEntityReference().getXref().size()); Protein p2 = (new ShallowCopy()).copy(p1, "p1"); assertEquals(p1.getUri(), p2.getUri()); assertFalse(p1 == p2); assertTrue(p1.isEquivalent(p2)); assertEquals(pr1, p2.getEntityReference()); assertEquals(2, p2.getEntityReference().getXref().size()); }
public <T extends BioPAXElement> T copy(Model model, T source, String newID) { T copy = copy(source, newID); model.add(copy); return copy; }
ShallowCopy implements Visitor { public <T extends BioPAXElement> T copy(Model model, T source, String newID) { T copy = copy(source, newID); model.add(copy); return copy; } }
ShallowCopy implements Visitor { public <T extends BioPAXElement> T copy(Model model, T source, String newID) { T copy = copy(source, newID); model.add(copy); return copy; } ShallowCopy(EditorMap map);  ShallowCopy(BioPAXLevel level);  ShallowCopy(); }
ShallowCopy implements Visitor { public <T extends BioPAXElement> T copy(Model model, T source, String newID) { T copy = copy(source, newID); model.add(copy); return copy; } ShallowCopy(EditorMap map);  ShallowCopy(BioPAXLevel level);  ShallowCopy(); T copy(Model model, T source, String newID); T copy(T source, String newID); void visit(BioPAXElement domain, Object range, Model model, PropertyEditor editor); }
ShallowCopy implements Visitor { public <T extends BioPAXElement> T copy(Model model, T source, String newID) { T copy = copy(source, newID); model.add(copy); return copy; } ShallowCopy(EditorMap map);  ShallowCopy(BioPAXLevel level);  ShallowCopy(); T copy(Model model, T source, String newID); T copy(T source, String newID); void visit(BioPAXElement domain, Object range, Model model, PropertyEditor editor);  }