Package com.tangosol.util
Class FilterEnumerator
- java.lang.Object
-
- com.tangosol.util.Base
-
- com.tangosol.util.FilterEnumerator
-
- All Implemented Interfaces:
Enumeration
,Iterator
public class FilterEnumerator extends Base implements Enumeration, Iterator
Provide a generic implementation of an enumerator which can enumerate items based on an inclusion test.- Author:
- cp 1997.09.05, cp 1998.08.07
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.tangosol.util.Base
Base.LoggingWriter
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
m_fNext
Is there a next item which passed the test?protected boolean
m_fPrev
Is there a previous item which passed the test and can be removed?protected Iterator
m_iter
Objects to filter/enumerate.protected Object
m_oNext
The next item which passed the test.protected Filter
m_test
Test to perform on each item.
-
Constructor Summary
Constructors Constructor Description FilterEnumerator(Object[] aoItem, Filter test)
Construct the Filter enumerator based on an array of objects.FilterEnumerator(Enumeration enmr, Filter test)
Construct the Filter enumerator based on an Enumeration.FilterEnumerator(Iterator iter, Filter test)
Construct the Filter enumerator based on an Iterator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
hasMoreElements()
Tests if this enumeration contains more elements.boolean
hasNext()
Tests if this Iterator contains more elements.Object
next()
Returns the next element of this Iterator.Object
nextElement()
Get the next element in the enumeration.void
remove()
Remove the last-returned element that was returned by the Iterator.-
Methods inherited from class com.tangosol.util.Base
azzert, azzert, azzert, azzertFailed, breakLines, breakLines, capitalize, checkNotEmpty, checkNotNull, checkRange, computeSafeWaitTime, decimalValue, dup, dup, ensureBigDecimal, ensureClassLoader, ensureRuntimeException, ensureRuntimeException, equals, equalsDeep, err, err, err, err, err, escape, formatDateTime, getCallerStackFrame, getCommonMonitor, getCommonMonitor, getCommonMonitor, getContextClassLoader, getContextClassLoader, getDeepMessage, getErr, getLastSafeTimeMillis, getLog, getMaxDecDigits, getMaxHexDigits, getOriginalException, getOut, getProcessRandom, getRandom, getRandomBinary, getRandomBinary, getRandomString, getSafeTimeMillis, getStackFrame, getStackFrames, getStackTrace, getStackTrace, getStackTrace, getThreadFactory, getTimeZone, getUpTimeMillis, hashCode, hexValue, indentString, indentString, isDecimal, isHex, isLogEcho, isOctal, log, log, log, log, log, makeInteger, makeLong, makeThread, mergeArray, mergeBooleanArray, mergeByteArray, mergeCharArray, mergeDoubleArray, mergeFloatArray, mergeIntArray, mergeLongArray, mod, mod, octalValue, out, out, out, out, out, pad, parseBandwidth, parseBandwidth, parseDelimitedString, parseHex, parseHex, parseMemorySize, parseMemorySize, parsePercentage, parseTime, parseTime, parseTimeNanos, parseTimeNanos, printStackTrace, randomize, randomize, randomize, randomize, read, read, read, read, read, read, read, replace, setErr, setLog, setLogEcho, setOut, sleep, toBandwidthString, toBandwidthString, toCharEscape, toCrc, toCrc, toCrc, toCrc, toCrc, toDecString, toDelimitedString, toDelimitedString, toDelimitedString, toDelimitedString, toHex, toHex, toHexDump, toHexEscape, toHexEscape, toHexEscape, toHexEscape, toHexString, toMemorySizeString, toMemorySizeString, toQuotedCharEscape, toQuotedStringEscape, toSqlString, toString, toString, toStringEscape, toUnicodeEscape, trace, trace, trace, trace, trace, trace, trace, trace, trace, truncateString, truncateString, wait
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Enumeration
asIterator
-
Methods inherited from interface java.util.Iterator
forEachRemaining
-
-
-
-
Field Detail
-
m_iter
protected Iterator m_iter
Objects to filter/enumerate.
-
m_test
protected Filter m_test
Test to perform on each item.
-
m_fNext
protected boolean m_fNext
Is there a next item which passed the test?
-
m_fPrev
protected boolean m_fPrev
Is there a previous item which passed the test and can be removed?
-
m_oNext
protected Object m_oNext
The next item which passed the test.
-
-
Constructor Detail
-
FilterEnumerator
public FilterEnumerator(Enumeration enmr, Filter test)
Construct the Filter enumerator based on an Enumeration.- Parameters:
enmr
- Enumeration of objects to filtertest
- an inclusion test
-
FilterEnumerator
public FilterEnumerator(Iterator iter, Filter test)
Construct the Filter enumerator based on an Iterator.- Parameters:
iter
- Iterator of objects to filtertest
- an inclusion test
-
-
Method Detail
-
hasMoreElements
public boolean hasMoreElements()
Tests if this enumeration contains more elements.- Specified by:
hasMoreElements
in interfaceEnumeration
- Returns:
- false if the enumeration has been exhausted
-
nextElement
public Object nextElement()
Get the next element in the enumeration.- Specified by:
nextElement
in interfaceEnumeration
- Returns:
- the next element of this enumeration
-
hasNext
public boolean hasNext()
Tests if this Iterator contains more elements.
-
next
public Object next()
Returns the next element of this Iterator.
-
-