private static Set < BioPAXElement > convertQueryResult ( Set < GraphObject > resultWrappers , Graph graph , boolean removeDisconnected ) { Set < Object > result = graph . getWrappedSet ( resultWrappers ) ; Set < BioPAXElement > set = new HashSet < BioPAXElement > ( ) ; for ( Object o : result ) { set . add ( ( BioPAXElement ) o ) ; } // remove disconnected simple physical entities if ( removeDisconnected ) { Set < BioPAXElement > remove = new HashSet < BioPAXElement > ( ) ; for ( BioPAXElement ele : set ) { if ( ele instanceof SimplePhysicalEntity && isDisconnected ( ( SimplePhysicalEntity ) ele , set ) ) { remove . add ( ele ) ; } } set . removeAll ( remove ) ; } return set ; }
Converts the query result from wrappers to wrapped BioPAX elements .