public static ArrayModifiableDBIDs getObjectsByLabelMatch ( Database database , Pattern name_pattern ) { Relation < String > relation = guessLabelRepresentation ( database ) ; if ( name_pattern == null ) { return DBIDUtil . newArray ( ) ; } ArrayModifiableDBIDs ret = DBIDUtil . newArray ( ) ; for ( DBIDIter iditer = relation . iterDBIDs ( ) ; iditer . valid ( ) ; iditer . advance ( ) ) { if ( name_pattern . matcher ( relation . get ( iditer ) ) . find ( ) ) { ret . add ( iditer ) ; } } return ret ; }
Find object by matching their labels .