public Entity addAttributes(Entity from, Entity to) { to.getLabel().addAll(from.getLabel()); to.getType().addAll(from.getType()); to.getLocation().addAll(from.getLocation()); to.getOther().addAll(from.getOther()); return to; }
public Entity addAttributes(Entity from, Entity to) { to.getLabel().addAll(from.getLabel()); to.getType().addAll(from.getType()); to.getLocation().addAll(from.getLocation()); to.getOther().addAll(from.getOther()); return to; }
/** * Creates a copy of an entity. The copy is shallow in the sense that the new Entity shares the same attributes as the original Entity. * @param e an {@link Entity} to copy * @return a copy of the input {@link Entity} */ public Entity newEntity(Entity e) { Entity res = newEntity(e.getId()); res.getOther().addAll(e.getOther()); res.getType().addAll(e.getType()); res.getLabel().addAll(e.getLabel()); res.getLocation().addAll(e.getLocation()); return res; }
/** * Creates a copy of an entity. The copy is shallow in the sense that the new Entity shares the same attributes as the original Entity. * @param e an {@link Entity} to copy * @return a copy of the input {@link Entity} */ public Entity newEntity(Entity e) { Entity res = newEntity(e.getId()); res.getOther().addAll(e.getOther()); res.getType().addAll(e.getType()); res.getLabel().addAll(e.getLabel()); res.getLocation().addAll(e.getLocation()); return res; }
public void testEntityWithOneLocationAttribute(int i) { Entity a = pFactory.newEntity(q("en_l" + i)); Object [] pair= attributeValues[i]; Object value=pair[0]; QualifiedName type=(QualifiedName) pair[1]; a.getLocation().add(pFactory.newLocation(value,type)); makeDocAndTest(a,"target/attr_entity_one_location_attr"+i); }
a.getLocation().add(pFactory.newLocation("un llieu", name.XSD_STRING)); a.getLocation().add(pFactory.newLocation(1, name.XSD_INT)); a.getLocation() .add(pFactory.newLocation(2.0, name.XSD_DOUBLE)); a.getLocation().add(pFactory.newLocation(EX_NS + "london", name.XSD_ANY_URI)); a.getLocation().add(loc);
public void testDoc203() { Document idoc203=new IndexedDocument(pFactory,makeDoc203()).toDocument(); assertEquals(idoc203.getStatementOrBundle().size(),1); Entity e=(Entity)idoc203.getStatementOrBundle().get(0); assertEquals("label", e.getLabel().size(),1); assertEquals("location", e.getLocation().size(),1); assertEquals("type", e.getType().size(),1); assertEquals("other", e.getOther().size(),1); }
@Override public void doAction(Entity e) { register(e.getId()); registerLocation(e.getLocation()); registerType(e.getType()); registerValue(e.getValue()); registerOther(e.getOther()); }
@Override public void doAction(Entity e) { register(e.getId()); registerLocation(e.getLocation()); registerType(e.getType()); registerValue(e.getValue()); registerOther(e.getOther()); }
public Document makeDoc203() { Entity e1=pFactory.newEntity(q("e1")); Entity e2=pFactory.newEntity(q("e1")); e2.getLabel().add(pFactory.newInternationalizedString("hello")); e2.getLabel().add(pFactory.newInternationalizedString("hello")); e2.getLocation().add(pFactory.newLocation("liege", pFactory.getName().XSD_STRING)); e2.getLocation().add(pFactory.newLocation("liege", pFactory.getName().XSD_STRING)); e2.getLocation().add(pFactory.newLocation("liege", pFactory.getName().XSD_STRING)); e2.getType().add(pFactory.newType(q("TYPE"), pFactory.getName().PROV_QUALIFIED_NAME)); e2.getType().add(pFactory.newType(q("TYPE"), pFactory.getName().PROV_QUALIFIED_NAME)); e2.getOther().add(pFactory.newOther(q("ELEMENT"), 1, pFactory.getName().XSD_INT)); e2.getOther().add(pFactory.newOther(q("ELEMENT"), 1, pFactory.getName().XSD_INT)); Document doc=pFactory.newDocument(); doc.getStatementOrBundle().add(e1); doc.getStatementOrBundle().add(e2); Namespace nss=Namespace.gatherNamespaces(doc); doc.setNamespace(nss); return doc; }