Example #1
0
 private Node fetchNode(Graph g, Object2LongOpenHashMap<Instance> mapping, Instance inst) {
   if (mapping.containsKey(inst)) {
     return g.getNode(mapping.getLong(inst));
   }
   return createNode(g, mapping, inst);
 }
Example #2
0
 private Node createNode(Graph g, Object2LongOpenHashMap<Instance> mapping, Instance inst) {
   Node node = g.getFactory().newNode(inst);
   mapping.put(inst, node.getId());
   g.addNode(node);
   return node;
 }