Package com.tangosol.util
Class SortedBag.ViewBag
java.lang.Object
java.util.AbstractCollection<E>
com.tangosol.util.SortedBag<E>
com.tangosol.util.SortedBag.ViewBag
- All Implemented Interfaces:
Iterable<E>
,Collection<E>
A range-limited view of the SortedBag. This view is backed by the
SortedBag, so any modifications made to it are visible to the underlying
bag, and vice-versa.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.tangosol.util.SortedBag
SortedBag.UniqueElement<E>, SortedBag.ViewBag, SortedBag.WrapperComparator
-
Field Summary
Modifier and TypeFieldDescriptionprotected final Object
The (inclusive) lower bound of this view.protected final Object
The (exclusive) upper bound of this view.Fields inherited from class com.tangosol.util.SortedBag
m_atomicNonce, m_comparator, m_map, NO_VALUE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
protected void
checkRange
(Object o) Check that the specified object is within the range of this view.Returns a view of the portion of this bag whose elements are strictly less than toElement.Returns a view of the portion of this bag whose elements range from fromElement, inclusive, to toElement, exclusive.Returns a view of the portion of this bag whose elements are greater than or equal to fromElement.Methods inherited from class com.tangosol.util.SortedBag
contains, first, getComparator, getInternalMap, getNonceCounter, instantiateInternalMap, isEmpty, iterator, last, remove, removeFirst, removeLast, size, unwrap, wrap
Methods inherited from class java.util.AbstractCollection
addAll, clear, containsAll, removeAll, retainAll, toArray, toArray, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
equals, hashCode, parallelStream, removeIf, spliterator, stream, toArray
-
Field Details
-
f_oFrom
The (inclusive) lower bound of this view. -
f_oTo
The (exclusive) upper bound of this view.
-
-
Constructor Details
-
ViewBag
Construct a view of the SortedBag, constrained to the range [from, to).- Parameters:
from
- the "from" element (inclusive), or nullto
- the "to" element (exclusive), or null
-
-
Method Details
-
add
-
subBag
Returns a view of the portion of this bag whose elements range from fromElement, inclusive, to toElement, exclusive. (If fromElement and toElement are equal, the returned bag is empty.) The returned bag is backed by this bag, so changes in the returned bag are reflected in this bag, and vice-versa. The returned bag supports all optional bag operations that this bag supports.The returned bag will throw an IllegalArgumentException on an attempt to insert an element outside its range.
-
headBag
Returns a view of the portion of this bag whose elements are strictly less than toElement. The returned bag is backed by this bag, so changes in the returned bag are reflected in this bag, and vice-versa. The returned bag supports all optional bag operations that this bag supports.The returned bag will throw an IllegalArgumentException on an attempt to insert an element outside its range.
-
tailBag
Returns a view of the portion of this bag whose elements are greater than or equal to fromElement. The returned bag is backed by this bag, so changes in the returned bag are reflected in this bag, and vice-versa. The returned bag supports all optional bag operations that this bag supports.The returned bag will throw an IllegalArgumentException on an attempt to insert an element outside its range.
-
checkRange
Check that the specified object is within the range of this view.- Parameters:
o
- the object to check
-