use of org.neo4j.kernel.impl.util.RelIdArray in project graphdb by neo4j-attic.
the class NodeImpl method getAllRelationships.
List<RelTypeElementIterator> getAllRelationships(NodeManager nodeManager) {
ensureRelationshipMapNotNull(nodeManager);
List<RelTypeElementIterator> relTypeList = new LinkedList<RelTypeElementIterator>();
boolean hasModifications = nodeManager.getLockReleaser().hasRelationshipModifications(this);
ArrayMap<String, RelIdArray> addMap = null;
if (hasModifications) {
addMap = nodeManager.getCowRelationshipAddMap(this);
}
for (String type : relationshipMap.keySet()) {
RelIdArray src = relationshipMap.get(type);
RelIdArray remove = null;
RelIdArray add = null;
if (hasModifications) {
remove = nodeManager.getCowRelationshipRemoveMap(this, type);
if (addMap != null) {
add = addMap.get(type);
}
}
// if ( src != null || add != null )
// {
relTypeList.add(RelTypeElement.create(type, this, src, add, remove));
// }
}
if (addMap != null) {
for (String type : addMap.keySet()) {
if (relationshipMap.get(type) == null) {
RelIdArray remove = nodeManager.getCowRelationshipRemoveMap(this, type);
RelIdArray add = addMap.get(type);
relTypeList.add(RelTypeElement.create(type, this, null, add, remove));
}
}
}
return relTypeList;
}
Aggregations