Package com.tangosol.util
Class RestrictedCollections.RestrictedListIterator
java.lang.Object
com.tangosol.util.Base
com.tangosol.util.RestrictedCollections.RestrictedListIterator
- All Implemented Interfaces:
 Iterator,ListIterator
- Enclosing class:
 RestrictedCollections
public static class RestrictedCollections.RestrictedListIterator
extends Base
implements ListIterator
A restricted ListIterator that requires its contents to be of a
 specified class.
- 
Nested Class Summary
Nested classes/interfaces inherited from class com.tangosol.util.Base
Base.LoggingWriter - 
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ClassThe class of Objects stored in the ListIterator.protected ListIteratorThe underlying ListIterator. - 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionvoidInserts the specified element into the list.protected voidCheck the passed object to verify that it passes the restriction of this ListIterator.booleanhasNext()Returns true if this list iterator has more elements when traversing the list in the forward direction.booleanReturns true if this list iterator has more elements when traversing the list in the reverse direction.next()Returns the next element in the list.intReturns the index of the element that would be returned by a subsequent call to next.previous()Returns the previous element in the list.intReturns the index of the element that would be returned by a subsequent call to previous.voidremove()Removes from the list the last element that was returned by next or previous.voidReplaces the last element returned by next or previous with the specified element.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, newHashMap, newHashMap, newHashSet, newHashSet, 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, waitMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Iterator
forEachRemaining 
- 
Field Details
- 
m_iter
The underlying ListIterator. - 
m_clz
The class of Objects stored in the ListIterator. 
 - 
 - 
Constructor Details
- 
RestrictedListIterator
Constructor.- Parameters:
 iter- the underlying ListIteratorclz- the class of objects that may be stored in the ListIterator
 
 - 
 - 
Method Details
- 
hasNext
public boolean hasNext()Returns true if this list iterator has more elements when traversing the list in the forward direction. Obeys the general contract of ListIterator.hasNext.- Specified by:
 hasNextin interfaceIterator- Specified by:
 hasNextin interfaceListIterator- Returns:
 - true if the list iterator has more elements when traversing the list in the forward direction
 
 - 
next
Returns the next element in the list. Obeys the general contract of ListIterator.next.- Specified by:
 nextin interfaceIterator- Specified by:
 nextin interfaceListIterator- Returns:
 - the next element in the list
 
 - 
hasPrevious
public boolean hasPrevious()Returns true if this list iterator has more elements when traversing the list in the reverse direction. Obeys the general contract of ListIterator.hasPrevious.- Specified by:
 hasPreviousin interfaceListIterator- Returns:
 - true if the list iterator has more elements when traversing the list in the reverse direction
 
 - 
previous
Returns the previous element in the list. Obeys the general contract of ListIterator.previous.- Specified by:
 previousin interfaceListIterator- Returns:
 - the previous element in the list
 - Throws:
 NoSuchElementException- if the iteration has no previous element
 - 
nextIndex
public int nextIndex()Returns the index of the element that would be returned by a subsequent call to next. Obeys the general contract of ListIterator.nextIndex.- Specified by:
 nextIndexin interfaceListIterator- Returns:
 - the index of the element that would be returned by a subsequent call to next, or list size if list iterator is at end of list
 
 - 
previousIndex
public int previousIndex()Returns the index of the element that would be returned by a subsequent call to previous. Obeys the general contract of ListIterator.previousIndex.- Specified by:
 previousIndexin interfaceListIterator- Returns:
 - the index of the element that would be returned by a subsequent call to previous, or -1 if list iterator is at beginning of list
 
 - 
remove
public void remove()Removes from the list the last element that was returned by next or previous. Obeys the general contract of ListIterator.remove.- Specified by:
 removein interfaceIterator- Specified by:
 removein interfaceListIterator
 - 
set
Replaces the last element returned by next or previous with the specified element. Obeys the general contract of ListIterator.set.- Specified by:
 setin interfaceListIterator- Parameters:
 o- the element with which to replace the last element returned by next or previous- Throws:
 ClassCastException- if the class of the specified element prevents it from being added to this list
 - 
add
Inserts the specified element into the list. Obeys the general contract of ListIterator.add.- Specified by:
 addin interfaceListIterator- Parameters:
 o- the element to insert- Throws:
 ClassCastException- if the class of the specified element prevents it from being added to this ListIterator
 - 
checkObject
Check the passed object to verify that it passes the restriction of this ListIterator.- Parameters:
 o- the Object to check- Throws:
 ClassCastException- if the class of the passed Object prevents it from being stored in this ListIterator
 
 -