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 AbstractList<T> implements FilterableList<T,S>
FilterableList
.FilterableList.AbstractBase<T,S extends FilterableList<T,S>>, FilterableList.Empty<T,S extends FilterableList<T,S>>
modCount
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(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
add, add, addAll, addAll, clear, contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, replaceAll, retainAll, set, size, sort, spliterator, toArray, toArray
parallelStream, removeIf, stream
public S filter(ElementMatcher<? super T> elementMatcher)
FilterableList
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()
FilterableList
IllegalStateException
is thrown.getOnly
in interface FilterableList<T,S extends FilterableList<T,S>>
public S subList(int fromIndex, int toIndex)
subList
in interface List<T>
subList
in interface FilterableList<T,S extends FilterableList<T,S>>
subList
in class AbstractList<T>
Copyright © 2014. All rights reserved.