Class ListPlusOne<T>
java.lang.Object
java.util.AbstractCollection<T>
java.util.AbstractList<T>
de.xima.fc.common.collection.ListPlusOne<T>
- Type Parameters:
T- Type of the list items.
- All Implemented Interfaces:
Serializable, Iterable<T>, Collection<T>, List<T>, RandomAccess
An unmodifiable list that extends another list and includes an additional item at the end.
- Since:
- 8.4.0
- See Also:
-
Field Summary
Fields inherited from class AbstractList
modCount -
Constructor Summary
ConstructorsConstructorDescriptionListPlusOne(List<T> head, T tail) Constructs a new list that includes the specified end item at the end of another list. -
Method Summary
Methods inherited from class AbstractList
add, add, addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subListMethods inherited from class AbstractCollection
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toStringMethods inherited from interface Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface List
addAll, contains, containsAll, isEmpty, remove, removeAll, replaceAll, retainAll, sort, spliterator, toArray, toArray
-
Constructor Details
-
ListPlusOne
Constructs a new list that includes the specified end item at the end of another list. If the end item is null, this will not affect the size, i.e. the resulting list will have a null element at the end position.- Parameters:
head- The parent list to be included after the start item.tail- The item to be placed at the end of the list.
-
-
Method Details
-
get
-
size
public int size()- Specified by:
sizein interfaceCollection<T>- Specified by:
sizein interfaceList<T>- Specified by:
sizein classAbstractCollection<T>
-