|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecthenplus.view.util.SortedMatchIterator
public class SortedMatchIterator
An Iterator returning end-truncated matching values from a sorted List.
This Iterator is initialized with a sorted Set, sorted Map or another Iterator that must be placed at the beginning of the matching area of a sorted set.
This Iterator is commonly used for TAB-completion..
Constructor Summary | |
---|---|
SortedMatchIterator(String partialMatch,
Iterator it)
Return all Key-Elements from the given Iterator that have the common prefix given in 'partialMatch'. |
|
SortedMatchIterator(String partialMatch,
SortedMap map)
Return all Key-Elements from the given SortedMap that have the common prefix given in 'partialMatch'. |
|
SortedMatchIterator(String partialMatch,
SortedSet set)
Return all Key-Elements from the given SortedSet that have the common prefix given in 'partialMatch'. |
Method Summary | |
---|---|
protected boolean |
exclude(String current)
Override this method if you want to exclude certain values from the iterated values returned. |
boolean |
hasNext()
|
Object |
next()
|
void |
remove()
|
void |
setPrefix(String prefix)
If a prefix is set, then return the matching element with with this prefix prepended. |
void |
setSuffix(String suffix)
If a suffix is set, then return the matching element with with this suffix appended. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SortedMatchIterator(String partialMatch, Iterator it)
partialMatch
- the prefix that should matchit
- the Iterator positioned at the first partial match.public SortedMatchIterator(String partialMatch, SortedSet set)
partialMatch
- the prefix that should matchset
- the SortedSet from which the matches should be iterated.public SortedMatchIterator(String partialMatch, SortedMap map)
partialMatch
- the prefix that should matchmap
- the SortedMap from its matching keys the matches should be
iterated.Method Detail |
---|
public void setPrefix(String prefix)
public void setSuffix(String suffix)
protected boolean exclude(String current)
public boolean hasNext()
hasNext
in interface Iterator
public Object next()
next
in interface Iterator
public void remove()
remove
in interface Iterator
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |