Package de.xima.fc.common.collection
Class ListWithoutItemAtIndex<T>
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<T>
-
- de.xima.fc.common.collection.ListWithoutItemAtIndex<T>
-
- Type Parameters:
T
- Type of the list items.
- All Implemented Interfaces:
Iterable<T>
,Collection<T>
,List<T>
public final class ListWithoutItemAtIndex<T> extends AbstractList<T>
A read-only list that excludes a specific item at a given index from another list.- Since:
- 8.4.0
-
-
Field Summary
-
Fields inherited from class java.util.AbstractList
modCount
-
-
Constructor Summary
Constructors Constructor Description ListWithoutItemAtIndex(List<? extends T> list, int toExclude)
Constructs a new list that excludes the item at the specified index from the provided list.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description T
get(int index)
int
size()
-
Methods inherited from class java.util.AbstractList
add, add, addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subList
-
Methods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Methods inherited from interface java.util.List
addAll, contains, containsAll, isEmpty, remove, removeAll, replaceAll, retainAll, sort, spliterator, toArray, toArray
-
-
-
-
Constructor Detail
-
ListWithoutItemAtIndex
public ListWithoutItemAtIndex(List<? extends T> list, int toExclude)
Constructs a new list that excludes the item at the specified index from the provided list.- Parameters:
list
- The original list from which an item will be excluded.toExclude
- The index of the item to exclude from the list.- Throws:
ArrayIndexOutOfBoundsException
- if the index to exclude is out of bounds.
-
-