Package org.opencastproject.util.data
Class NonEmptyList<A>
java.lang.Object
org.opencastproject.util.data.NonEmptyList<A>
- Type Parameters:
A- content type
- All Implemented Interfaces:
Iterable<A>,Collection<A>,List<A>,SequencedCollection<A>
Non empty list. Also immutable.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbooleanbooleanaddAll(int i, Collection<? extends A> as) booleanaddAll(Collection<? extends A> as) voidclear()booleanbooleancontainsAll(Collection<?> objects) get(int i) intbooleanisEmpty()iterator()intlistIterator(int i) remove(int i) booleanbooleanremoveAll(Collection<?> objects) booleanretainAll(Collection<?> objects) intsize()subList(int i, int i1) Object[]toArray()<T> T[]toArray(T[] ts) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface java.util.List
addFirst, addLast, equals, getFirst, getLast, hashCode, removeFirst, removeLast, replaceAll, reversed, sort, spliterator
-
Constructor Details
-
NonEmptyList
-
NonEmptyList
- Throws:
IllegalArgumentException- collection is empty
-
-
Method Details
-
size
public int size() -
isEmpty
public boolean isEmpty() -
contains
-
iterator
-
toArray
-
toArray
public <T> T[] toArray(T[] ts) -
add
-
remove
-
containsAll
- Specified by:
containsAllin interfaceCollection<A>- Specified by:
containsAllin interfaceList<A>
-
addAll
-
addAll
-
removeAll
-
retainAll
-
clear
public void clear() -
get
-
set
-
add
-
remove
-
indexOf
-
lastIndexOf
- Specified by:
lastIndexOfin interfaceList<A>
-
listIterator
- Specified by:
listIteratorin interfaceList<A>
-
listIterator
- Specified by:
listIteratorin interfaceList<A>
-
subList
-