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>
protected class SortedBag.ViewBag extends SortedBag<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
Fields Modifier and Type Field Description protected Object
f_oFrom
The (inclusive) lower bound of this view.protected Object
f_oTo
The (exclusive) upper bound of this view.-
Fields inherited from class com.tangosol.util.SortedBag
m_atomicNonce, m_comparator, m_map, NO_VALUE
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
add(E o)
protected void
checkRange(Object o)
Check that the specified object is within the range of this view.SortedBag<E>
headBag(E toElement)
Returns a view of the portion of this bag whose elements are strictly less than toElement.SortedBag<E>
subBag(E fromElement, E toElement)
Returns a view of the portion of this bag whose elements range from fromElement, inclusive, to toElement, exclusive.SortedBag<E>
tailBag(E fromElement)
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
-
-
-
-
Method Detail
-
add
public boolean add(E o)
-
subBag
public SortedBag<E> subBag(E fromElement, E toElement)
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
public SortedBag<E> headBag(E toElement)
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
public SortedBag<E> tailBag(E fromElement)
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
protected void checkRange(Object o)
Check that the specified object is within the range of this view.- Parameters:
o
- the object to check
-
-