Package eu.bandm.tools.umod.runtime
Class CheckedList<T>
- java.lang.Object
-
- eu.bandm.tools.umod.runtime.CheckedList<T>
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Iterable<T>
,java.util.Collection<T>
,java.util.List<T>
- Direct Known Subclasses:
CheckedListPlus
public class CheckedList<T> extends java.lang.Object implements java.util.List<T>, java.io.Serializable
Implements a List which is strict in all its elements. The implementation is done by delegation to some peer object from a predefined java runtime class. The kind of implementation (linked list or array list) can be selected by a parameter to the constructor.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
CheckedList.CheckedListIterator
static class
CheckedList.implementations
-
Constructor Summary
Constructors Constructor Description CheckedList()
CheckedList(int capacity)
CheckedList(CheckedList.implementations implementation)
CheckedList(CheckedList.implementations implementation, java.util.List<? extends T> prototype)
CheckedList(CheckedList.implementations implementation, T... data)
CheckedList(java.util.List<? extends T> prototype)
CheckedList(T... data)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(int index, T item)
boolean
add(T t)
boolean
addAll(int index, java.util.Collection<? extends T> c)
boolean
addAll(java.util.Collection<? extends T> c)
void
clear()
boolean
contains(java.lang.Object o)
boolean
containsAll(java.util.Collection<?> c)
boolean
equals(java.lang.Object o)
T
get(int index)
int
hashCode()
int
indexOf(java.lang.Object o)
boolean
isEmpty()
java.util.Iterator<T>
iterator()
int
lastIndexOf(java.lang.Object o)
java.util.ListIterator<T>
listIterator()
java.util.ListIterator<T>
listIterator(int index)
T
remove(int index)
boolean
remove(java.lang.Object o)
boolean
removeAll(java.util.Collection<?> c)
boolean
retainAll(java.util.Collection<?> c)
T
set(int index, T item)
static <T> CheckedList<T>
singleton(T x)
int
size()
java.util.List<T>
subList(int fromIndex, int toIndex)
java.lang.Object[]
toArray()
<T> T[]
toArray(T[] a)
java.lang.String
toString()
-
-
-
Field Detail
-
peer
protected java.util.List<T> peer
-
-
Constructor Detail
-
CheckedList
public CheckedList()
-
CheckedList
public CheckedList(int capacity)
-
CheckedList
public CheckedList(CheckedList.implementations implementation)
-
CheckedList
public CheckedList(CheckedList.implementations implementation, java.util.List<? extends T> prototype)
-
CheckedList
public CheckedList(java.util.List<? extends T> prototype)
-
CheckedList
@SafeVarargs public CheckedList(CheckedList.implementations implementation, T... data)
-
CheckedList
@SafeVarargs public CheckedList(T... data)
-
-
Method Detail
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
add
public boolean add(T t)
-
addAll
public boolean addAll(java.util.Collection<? extends T> c)
-
addAll
public boolean addAll(int index, java.util.Collection<? extends T> c)
- Specified by:
addAll
in interfacejava.util.List<T>
-
clear
public void clear()
-
contains
public boolean contains(java.lang.Object o)
-
containsAll
public boolean containsAll(java.util.Collection<?> c)
-
equals
public boolean equals(java.lang.Object o)
-
hashCode
public int hashCode()
-
indexOf
public int indexOf(java.lang.Object o)
- Specified by:
indexOf
in interfacejava.util.List<T>
-
isEmpty
public boolean isEmpty()
-
iterator
public java.util.Iterator<T> iterator()
-
lastIndexOf
public int lastIndexOf(java.lang.Object o)
- Specified by:
lastIndexOf
in interfacejava.util.List<T>
-
listIterator
public java.util.ListIterator<T> listIterator()
- Specified by:
listIterator
in interfacejava.util.List<T>
-
listIterator
public java.util.ListIterator<T> listIterator(int index)
- Specified by:
listIterator
in interfacejava.util.List<T>
-
remove
public boolean remove(java.lang.Object o)
-
removeAll
public boolean removeAll(java.util.Collection<?> c)
-
retainAll
public boolean retainAll(java.util.Collection<?> c)
-
size
public int size()
-
subList
public java.util.List<T> subList(int fromIndex, int toIndex)
- Specified by:
subList
in interfacejava.util.List<T>
-
toArray
public java.lang.Object[] toArray()
-
toArray
public <T> T[] toArray(T[] a)
-
singleton
public static <T> CheckedList<T> singleton(T x)
-
-