Package eu.bandm.tools.tdom.runtime
Class CheckedListPlus<T>
java.lang.Object
eu.bandm.tools.umod.runtime.CheckedList<T>
eu.bandm.tools.tdom.runtime.CheckedListPlus<T>
- All Implemented Interfaces:
Serializable,Iterable<T>,Collection<T>,List<T>,SequencedCollection<T>
Extends the checked list to ensure that it does not become empty.
Esp. there is no constructor for an empty instance.
Please note: this class (and its superclass) are safe only against accidental errors, not against malicious attacks e.g. by subclassing.
Please note: this class (and its superclass) are safe only against accidental errors, not against malicious attacks e.g. by subclassing.
- See Also:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class eu.bandm.tools.umod.runtime.CheckedList
CheckedList.CheckedListIterator, CheckedList.implementations -
Field Summary
Fields inherited from class eu.bandm.tools.umod.runtime.CheckedList
peer -
Constructor Summary
ConstructorsConstructorDescriptionCheckedListPlus(CheckedList.implementations implementation, List<? extends T> prototype) Create a list checked against null values and being empty.CheckedListPlus(CheckedList.implementations implementation, T... data) Create a list checked against null values and being empty.CheckedListPlus(List<? extends T> prototype) Create a list checkedArrayListagainst null values and being empty.CheckedListPlus(T... data) Create a list checkedArrayListagainst null values and being empty. -
Method Summary
Modifier and TypeMethodDescriptionprotected static <U> voidcheckNotEmpty(List<U> list) protected static <U> voidcheckNotNearlyEmpty(List<U> list) voidclear()Not possible!voidclearAndAdd(T t) Set list to a singleton list.listIterator(int index) remove(int index) booleanbooleanremoveAll(Collection<?> c) booleanretainAll(Collection<?> c) subList(int fromIndex, int toIndex) Methods inherited from class eu.bandm.tools.umod.runtime.CheckedList
add, add, addAll, addAll, contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, set, singleton, size, toArray, toArray, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface java.util.List
addFirst, addLast, getFirst, getLast, removeFirst, removeLast, replaceAll, reversed, sort, spliterator
-
Constructor Details
-
CheckedListPlus
Create a list checked against null values and being empty. See superclassCheckedListfor details on the implementation selection.- Throws:
IllegalArgumentException- if a null value is contained in the prototype, of if it is empty.
-
CheckedListPlus
Create a list checkedArrayListagainst null values and being empty. See superclassCheckedListfor details on the implementation selection.- Throws:
IllegalArgumentException- if a null value is contained in the prototype, of if it is empty.
-
CheckedListPlus
Create a list checked against null values and being empty. See superclassCheckedListfor details on the implementation selection.- Throws:
IllegalArgumentException- if a null value is contained in the prototype, of if it is empty.
-
CheckedListPlus
Create a list checkedArrayListagainst null values and being empty. See superclassCheckedListfor details on the implementation selection.- Throws:
IllegalArgumentException- if a null value is contained in the prototype, of if it is empty.
-
-
Method Details
-
checkNotEmpty
-
checkNotNearlyEmpty
-
clear
public void clear()Not possible!- Specified by:
clearin interfaceCollection<T>- Specified by:
clearin interfaceList<T>- Overrides:
clearin classCheckedList<T>- Throws:
UnsupportedOperationException- since this kind of list may never become empty.
-
clearAndAdd
Set list to a singleton list.- Throws:
IllegalArgumentException- if null is tried to enter.
-
listIterator
- Specified by:
listIteratorin interfaceList<T>- Overrides:
listIteratorin classCheckedList<T>
-
listIterator
- Specified by:
listIteratorin interfaceList<T>- Overrides:
listIteratorin classCheckedList<T>
-
remove
-
remove
- Specified by:
removein interfaceCollection<T>- Specified by:
removein interfaceList<T>- Overrides:
removein classCheckedList<T>
-
removeAll
- Specified by:
removeAllin interfaceCollection<T>- Specified by:
removeAllin interfaceList<T>- Overrides:
removeAllin classCheckedList<T>
-
retainAll
- Specified by:
retainAllin interfaceCollection<T>- Specified by:
retainAllin interfaceList<T>- Overrides:
retainAllin classCheckedList<T>
-
subList
-