Ejemplo n.º 1
0
  boolean getMoreRelationships(NodeManager nodeManager) {
    // ArrayMap<String, IntArray> tmpRelMap = relationshipMap;
    Pair<ArrayMap<String, RelIdArray>, Map<Long, RelationshipImpl>> pair;
    synchronized (this) {
      if (!relChainPosition.hasMore()) {
        return false;
      }

      pair = nodeManager.getMoreRelationships(this);
      ArrayMap<String, RelIdArray> addMap = pair.first();
      if (addMap.size() == 0) {
        return false;
      }
      for (String type : addMap.keySet()) {
        RelIdArray addRels = addMap.get(type);
        // IntArray srcRels = tmpRelMap.get( type );
        RelIdArray srcRels = relationshipMap.get(type);
        if (srcRels == null) {
          relationshipMap.put(type, addRels);
        } else {
          srcRels.addAll(addRels);
        }
      }
    }
    nodeManager.putAllInRelCache(pair.other());
    return true;
  }
Ejemplo n.º 2
0
 private Map<Long, RelationshipImpl> getMoreRelationships(
     NodeManager nodeManager, ArrayMap<String, RelIdArray> tmpRelMap) {
   if (!relChainPosition.hasMore()) {
     return null;
   }
   Pair<ArrayMap<String, RelIdArray>, Map<Long, RelationshipImpl>> pair =
       nodeManager.getMoreRelationships(this);
   ArrayMap<String, RelIdArray> addMap = pair.first();
   if (addMap.size() == 0) {
     return null;
   }
   for (String type : addMap.keySet()) {
     RelIdArray addRels = addMap.get(type);
     RelIdArray srcRels = tmpRelMap.get(type);
     if (srcRels == null) {
       tmpRelMap.put(type, addRels);
     } else {
       srcRels.addAll(addRels);
     }
   }
   return pair.other();
   // nodeManager.putAllInRelCache( pair.other() );
 }