public Resource < L > getParent ( Resource < L > resource ) { // do NOT call resource.getParent(), we want the one in our graph, not the one in the resource object graphLockRead . lock ( ) ; try { Set < Resource < L >> directParents = neighborIndex . predecessorsOf ( resource ) ; if ( directParents . isEmpty ( ) ) { return null ; } return directParents . iterator ( ) . next ( ) ; } finally { graphLockRead . unlock ( ) ; } }
Returns the direct parent of the given resource . This examines the internal hierarchical graph to determine parentage .