private List<Long> getChildrenByNodeId(Long nodeId) { List<Long> retval = new LinkedList<Long>(); Iterable<BatchRelationship> rels = Neo4JBatchInserter.getRelationships(nodeId); for (BatchRelationship rel : rels) { if (rel.getEndNode() == nodeId) continue; long childId = rel.getEndNode(); retval.add(childId); } return retval; }
private long getArgumentListByCallId(Long callNodeId) { Iterable<BatchRelationship> rels = Neo4JBatchInserter.getRelationships(callNodeId); for (BatchRelationship rel : rels) { long childId = rel.getEndNode(); if (childId == callNodeId) continue; String childType = (String) Neo4JBatchInserter.getNodeProperties(childId).get("type"); if (childType.equals("ArgumentList")) return childId; } return -1; }
private List<Long> getIdentifiersFromParams(List<Long> params) { List<Long> retval = new LinkedList<Long>(); for (Long paramId : params) { Iterable<BatchRelationship> rels = Neo4JBatchInserter.getRelationships(paramId); for (BatchRelationship rel : rels) { if (rel.getEndNode() == paramId) continue; long identifierNode = rel.getEndNode(); Object type = Neo4JBatchInserter.getNodeProperties(identifierNode).get("type"); if (type.equals("Identifier")) { retval.add(identifierNode); break; } } } return retval; }