public static < T extends BioPAXElement > Set < T > searchAndCollect ( Collection < ? extends BioPAXElement > eles , Pattern pattern , int index , Class < T > c ) { Set < T > set = new HashSet < T > ( ) ; for ( Match match : searchPlain ( eles , pattern ) ) { set . add ( ( T ) match . get ( index ) ) ; } return set ; }
Searches the given pattern starting from the given elements then collects the specified elements of the matches and returns .