public Edge addEdge( final Object id, final Vertex outVertex, final Vertex inVertex, final String label) { if (uniqueIds && null != id && null != getEdge(id)) { throw new IllegalArgumentException("Edge with given id already exists: " + id); } verifyNativeElement(outVertex); verifyNativeElement(inVertex); Edge base = baseGraph.addEdge( null, ((IdVertex) outVertex).getBaseVertex(), ((IdVertex) inVertex).getBaseVertex(), label); Object v = null == id ? edgeIdFactory.createId() : id; if (null == v) { base.removeProperty(ID); } else { base.setProperty(ID, v); } return new IdEdge(base); }
public Vertex addVertex(final Object id) { if (uniqueIds && null != id && null != getVertex(id)) { throw new IllegalArgumentException("Vertex with given id already exists: '" + id + "'"); } final Vertex base = baseGraph.addVertex(null); Object v = null == id ? vertexIdFactory.createId() : id; if (null == v) { base.removeProperty(ID); } else { base.setProperty(ID, v); } return new IdVertex(base); }
/** Helper für "buildCharElement". Setzt in einem CharElement alle notwendigen Felder */ private void createCharElement(CharElement charElement) { charElement.setId(IdFactory.getInstance().getId(charElement.getClass(), null)); charElement.setName("Unbenannt"); charElement.setAnzeigen(true); }