protected List < NodeInterface > getNodesAt ( final NodeInterface locationNode ) { final List < NodeInterface > nodes = new LinkedList <> ( ) ; for ( RelationshipInterface rel : locationNode . getIncomingRelationships ( NodeHasLocation . class ) ) { NodeInterface startNode = rel . getSourceNode ( ) ; nodes . add ( startNode ) ; // add more nodes which are "at" this one nodes . addAll ( getNodesAt ( startNode ) ) ; } return nodes ; }
Return all nodes which are connected by an incoming IS_AT relationships