public Iterator < Long > getNeighborhoodIterator ( final long id ) { return new Iterator < Long > ( ) { Iterator < Edge > iter = structure . getExistingOutEdgesIterator ( id ) ; @ Override public boolean hasNext ( ) { return iter . hasNext ( ) ; } @ Override public Long next ( ) { Edge e = iter . next ( ) ; return e . getFromNodeId ( ) == id ? e . getToNodeId ( ) : e . getFromNodeId ( ) ; } } ; }
Gets the neighborhood from a node represented by a given id . If the graph has any Node object with the given id this function returns an Iterator object representing all the neighboring Node objects to the given node . The neighboring nodes are given according to the outgoing edges of the Node object of the graph that has the given id .