All Downloads are FREE. Search and download functionalities are using the official Maven repository.

overflowdb.NodeFactory Maven / Gradle / Ivy

There is a newer version: 1.173
Show newest version
package overflowdb;

public abstract class NodeFactory {
  public abstract String forLabel();

  public abstract V createNode(NodeRef ref);

  public abstract NodeRef createNodeRef(Graph graph, long id);

  public V createNode(Graph graph, long id) {
    final NodeRef ref = createNodeRef(graph, id);
    final V node = createNode(ref);
    node.markAsDirty(); //freshly created, i.e. not yet serialized
    ref.setNode(node);
    return node;
  }

  public DetachedNodeData createDetached(){
    return new DetachedNodeGeneric(forLabel());
  }

}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy