private Map < String , String > getSuffixes ( String prefix , Boolean firstOnly ) { HashMap < String , String > matches = new HashMap <> ( ) ; prefix = normalizePrefix ( prefix ) ; int i = prefix . length ( ) ; for ( String itemName : index . keySet ( ) ) { if ( itemName . startsWith ( prefix ) ) { String suffix = lookupItemName ( itemName , false ) . substring ( i ) ; matches . put ( suffix , getItem ( itemName ) ) ; if ( firstOnly ) { break ; } } } return matches ; }
Returns a map consisting of suffixes of context items that match the specified prefix .