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