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>
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 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
ConstructorDescriptionCheckedListPlus
(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 checkedArrayList
against null values and being empty.CheckedListPlus
(T... data) Create a list checkedArrayList
against null values and being empty. -
Method Summary
Modifier and TypeMethodDescriptionprotected static <U> void
checkNotEmpty
(List<U> list) protected static <U> void
checkNotNearlyEmpty
(List<U> list) void
clear()
Not possible!void
clearAndAdd
(T t) Set list to a singleton list.listIterator
(int index) remove
(int index) boolean
boolean
removeAll
(Collection<?> c) boolean
retainAll
(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, 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
replaceAll, sort, spliterator
-
Constructor Details
-
CheckedListPlus
Create a list checked against null values and being empty. See superclassCheckedList
for 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 checkedArrayList
against null values and being empty. See superclassCheckedList
for 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 superclassCheckedList
for 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 checkedArrayList
against null values and being empty. See superclassCheckedList
for 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:
clear
in interfaceCollection<T>
- Specified by:
clear
in interfaceList<T>
- Overrides:
clear
in 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:
listIterator
in interfaceList<T>
- Overrides:
listIterator
in classCheckedList<T>
-
listIterator
- Specified by:
listIterator
in interfaceList<T>
- Overrides:
listIterator
in classCheckedList<T>
-
remove
-
remove
- Specified by:
remove
in interfaceCollection<T>
- Specified by:
remove
in interfaceList<T>
- Overrides:
remove
in classCheckedList<T>
-
removeAll
- Specified by:
removeAll
in interfaceCollection<T>
- Specified by:
removeAll
in interfaceList<T>
- Overrides:
removeAll
in classCheckedList<T>
-
retainAll
- Specified by:
retainAll
in interfaceCollection<T>
- Specified by:
retainAll
in interfaceList<T>
- Overrides:
retainAll
in classCheckedList<T>
-
subList
-