Package com.tangosol.util
Class ChainedEnumerator
java.lang.Object
com.tangosol.util.Base
com.tangosol.util.ChainedEnumerator
- All Implemented Interfaces:
Enumeration
,Iterator
Provide an enumerator which enumerates the contents of multiple
enumerators.
- Author:
- cp 1998.08.07
-
Nested Class Summary
Nested classes/interfaces inherited from class com.tangosol.util.Base
Base.LoggingWriter
-
Field Summary
-
Constructor Summary
ConstructorDescriptionConstruct an enumerator that will first enumerate multiple enumerators.ChainedEnumerator
(Enumeration enmrFirst) Construct an enumerator that will first enumerate the passed Enumeration.ChainedEnumerator
(Enumeration[] aEnum) Construct an enumerator that will first enumerate the Enumerations passed in the array as if they were together a single enumerator.ChainedEnumerator
(Enumeration enmrFirst, Enumeration enmrSecond) Construct an enumerator that will first enumerate the first Enumeration and then will enumerate the second Enumeration as if they were together a single Enumeration.ChainedEnumerator
(Iterator iterator) Construct an enumerator that will first enumerate the passed Iterator.ChainedEnumerator
(Iterator[] aIterator) Construct an enumerator that will first enumerate the Iterators passed in the array as if they were together a single enumerator.ChainedEnumerator
(Iterator iterFirst, Iterator iterSecond) Construct an enumerator that will first enumerate the first Iterator and then will enumerate the second Iterator as if they were together a single Iterator. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addEnumeration
(Enumeration enmr) Add the Enumeration to the end of the chain.void
addIterator
(Iterator iterator) Add the Iterator to the end of the chain.protected Iterator
Get the current or next enumeration in the listprotected Iterator
Get the recently used iterator, if any.boolean
Tests if this enumeration contains more elements.boolean
hasNext()
Tests if this Iterator contains more elements.next()
Returns the next element of this Iterator.Returns the next element of this 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 Details
-
m_listIter
The Iterators. -
m_iNextIter
protected int m_iNextIterThe next Iterator (index into the m_listIter) to iterate. -
m_iterCurrent
The current Iterator.
-
-
Constructor Details
-
ChainedEnumerator
public ChainedEnumerator()Construct an enumerator that will first enumerate multiple enumerators. -
ChainedEnumerator
Construct an enumerator that will first enumerate the passed Enumeration.- Parameters:
enmrFirst
- the first Enumeration
-
ChainedEnumerator
Construct an enumerator that will first enumerate the passed Iterator.- Parameters:
iterator
- the first Iterator
-
ChainedEnumerator
Construct an enumerator that will first enumerate the first Enumeration and then will enumerate the second Enumeration as if they were together a single Enumeration.- Parameters:
enmrFirst
- the first EnumerationenmrSecond
- the second Enumeration
-
ChainedEnumerator
Construct an enumerator that will first enumerate the first Iterator and then will enumerate the second Iterator as if they were together a single Iterator.- Parameters:
iterFirst
- the first IteratoriterSecond
- the second Iterator
-
ChainedEnumerator
Construct an enumerator that will first enumerate the Enumerations passed in the array as if they were together a single enumerator.- Parameters:
aEnum
- an array of Enumerations
-
ChainedEnumerator
Construct an enumerator that will first enumerate the Iterators passed in the array as if they were together a single enumerator.- Parameters:
aIterator
- an array of Iterators
-
-
Method Details
-
addEnumeration
Add the Enumeration to the end of the chain.- Parameters:
enmr
- an Enumeration
-
addIterator
Add the Iterator to the end of the chain.- Parameters:
iterator
- an Iterator
-
hasMoreElements
public boolean hasMoreElements()Tests if this enumeration contains more elements.- Specified by:
hasMoreElements
in interfaceEnumeration
- Returns:
- true if the enumeration contains more elements, false otherwise
-
nextElement
Returns the next element of this enumeration.- Specified by:
nextElement
in interfaceEnumeration
- Returns:
- the next element in the enumeration
-
hasNext
public boolean hasNext()Tests if this Iterator contains more elements. -
next
Returns the next element of this Iterator. -
remove
public void remove()Remove the last-returned element that was returned by the Iterator. This method always throws UnsupportedOperationException because the Iterator is immutable. -
getIterator
Get the current or next enumeration in the list- Returns:
- the current enumeration.
-
getRecentIterator
Get the recently used iterator, if any.- Returns:
- the iterator that was most recently used
-