Package com.ibm.icu.impl
Class TimeZoneNamesImpl.NameSearchHandler
- java.lang.Object
-
- com.ibm.icu.impl.TimeZoneNamesImpl.NameSearchHandler
-
- All Implemented Interfaces:
TextTrieMap.ResultHandler<TimeZoneNamesImpl.NameInfo>
- Enclosing class:
- TimeZoneNamesImpl
private static class TimeZoneNamesImpl.NameSearchHandler extends java.lang.Object implements TextTrieMap.ResultHandler<TimeZoneNamesImpl.NameInfo>
NameSearchHandler is used for collecting name matches.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Collection<TimeZoneNames.MatchInfo>
_matches
private int
_maxMatchLen
private java.util.EnumSet<TimeZoneNames.NameType>
_nameTypes
-
Constructor Summary
Constructors Constructor Description NameSearchHandler(java.util.EnumSet<TimeZoneNames.NameType> nameTypes)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Collection<TimeZoneNames.MatchInfo>
getMatches()
Returns the match resultsint
getMaxMatchLen()
Returns the maximum match length, or 0 if no match was foundboolean
handlePrefixMatch(int matchLength, java.util.Iterator<TimeZoneNamesImpl.NameInfo> values)
Handles a prefix key matchvoid
resetResults()
Resets the match results
-
-
-
Field Detail
-
_nameTypes
private java.util.EnumSet<TimeZoneNames.NameType> _nameTypes
-
_matches
private java.util.Collection<TimeZoneNames.MatchInfo> _matches
-
_maxMatchLen
private int _maxMatchLen
-
-
Constructor Detail
-
NameSearchHandler
NameSearchHandler(java.util.EnumSet<TimeZoneNames.NameType> nameTypes)
-
-
Method Detail
-
handlePrefixMatch
public boolean handlePrefixMatch(int matchLength, java.util.Iterator<TimeZoneNamesImpl.NameInfo> values)
Description copied from interface:TextTrieMap.ResultHandler
Handles a prefix key match- Specified by:
handlePrefixMatch
in interfaceTextTrieMap.ResultHandler<TimeZoneNamesImpl.NameInfo>
- Parameters:
matchLength
- Matched key's lengthvalues
- An iterator of the objects associated with the matched key- Returns:
- Return true to continue the search in the trie, false to quit.
-
getMatches
public java.util.Collection<TimeZoneNames.MatchInfo> getMatches()
Returns the match results- Returns:
- the match results
-
getMaxMatchLen
public int getMaxMatchLen()
Returns the maximum match length, or 0 if no match was found- Returns:
- the maximum match length
-
resetResults
public void resetResults()
Resets the match results
-
-