T
- The type of the collection's elements.S
- The type of this list.public abstract static class FilterableList.AbstractBase<T,S extends FilterableList<T,S>> extends java.util.AbstractList<T> implements FilterableList<T,S>
FilterableList
.FilterableList.AbstractBase<T,S extends FilterableList<T,S>>, FilterableList.Empty<T,S extends FilterableList<T,S>>
Modifier and Type | Field and Description |
---|---|
private static int |
ONLY
A convenience variable indicating the index of a list's only variable.
|
Constructor and Description |
---|
AbstractBase() |
Modifier and Type | Method and Description |
---|---|
S |
filter(ElementMatcher<? super T> elementMatcher)
Filters any elements in this lists by the given
elementMatcher and returns a list that are matched
by the given matcher. |
T |
getOnly()
Returns the only element of this list.
|
S |
subList(int fromIndex,
int toIndex) |
protected abstract S |
wrap(java.util.List<T> values)
Represents a list of values as an instance of this instance's list type.
|
add, add, addAll, clear, equals, get, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, set
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, size, toArray, toArray, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
private static final int ONLY
public S filter(ElementMatcher<? super T> elementMatcher)
elementMatcher
and returns a list that are matched
by the given matcher.filter
in interface FilterableList<T,S extends FilterableList<T,S>>
elementMatcher
- The element matcher to match the elements of this list against.public T getOnly()
IllegalStateException
is thrown.getOnly
in interface FilterableList<T,S extends FilterableList<T,S>>
public S subList(int fromIndex, int toIndex)
subList
in interface java.util.List<T>
subList
in interface FilterableList<T,S extends FilterableList<T,S>>
subList
in class java.util.AbstractList<T>