public class TypeCheckingList extends Object implements List, DeepCloneable
Modifier and Type | Class and Description |
---|---|
class |
TypeCheckingList.TypeCheckingListIterator |
Modifier | Constructor and Description |
---|---|
|
TypeCheckingList(Class type) |
|
TypeCheckingList(List backingList,
Class type) |
protected |
TypeCheckingList(List backingList,
Class type,
Class parentType)
Create a new Type checking list that checks for type type, but only if parentType is
equal to, a super class/interface of, or an interface implemented by type.
|
Modifier and Type | Method and Description |
---|---|
void |
add(int index,
Object o) |
boolean |
add(Object o) |
boolean |
addAll(Collection c) |
boolean |
addAll(int index,
Collection c) |
void |
clear() |
Object |
clone()
Create a shallow clone of the object
|
boolean |
contains(Object o) |
boolean |
containsAll(Collection c) |
protected List |
copyBackingList()
Make a copy of the wrapped list - used by subclasses when the overriding the clone method
|
Object |
deepClone()
Create a deep clone of the object
|
boolean |
equals(Object obj) |
Object |
get(int index) |
Class |
getType() |
protected TypeCheckingList.TypeCheckingListIterator |
getTypeCheckingListIterator() |
protected TypeCheckingList.TypeCheckingListIterator |
getTypeCheckingListIterator(int index) |
int |
indexOf(Object o) |
boolean |
isEmpty() |
Iterator |
iterator() |
int |
lastIndexOf(Object o) |
ListIterator |
listIterator() |
ListIterator |
listIterator(int index) |
Object |
remove(int index) |
boolean |
remove(Object o) |
boolean |
removeAll(Collection c) |
boolean |
retainAll(Collection c) |
Object |
set(int index,
Object element) |
int |
size() |
List |
subList(int fromIndex,
int toIndex) |
Object[] |
toArray() |
Object[] |
toArray(Object[] a) |
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
hashCode, replaceAll, sort, spliterator
parallelStream, removeIf, stream
public TypeCheckingList(Class type)
public Class getType()
public Object clone() throws CloneNotSupportedException
DeepCloneable
clone
in interface DeepCloneable
clone
in class Object
CloneNotSupportedException
protected List copyBackingList() throws CloneNotSupportedException
CloneNotSupportedException
public Object deepClone() throws UnsupportedOperationException
DeepCloneable
deepClone
in interface DeepCloneable
UnsupportedOperationException
public boolean equals(Object obj)
public boolean add(Object o)
add
in interface Collection
add
in interface List
public boolean addAll(Collection c)
addAll
in interface Collection
addAll
in interface List
public boolean addAll(int index, Collection c)
public boolean contains(Object o)
contains
in interface Collection
contains
in interface List
public boolean containsAll(Collection c)
containsAll
in interface Collection
containsAll
in interface List
public int lastIndexOf(Object o)
lastIndexOf
in interface List
public boolean remove(Object o)
remove
in interface Collection
remove
in interface List
public ListIterator listIterator()
listIterator
in interface List
public ListIterator listIterator(int index)
listIterator
in interface List
protected TypeCheckingList.TypeCheckingListIterator getTypeCheckingListIterator()
protected TypeCheckingList.TypeCheckingListIterator getTypeCheckingListIterator(int index)
public int size()
size
in interface Collection
size
in interface List
public boolean isEmpty()
isEmpty
in interface Collection
isEmpty
in interface List
public Iterator iterator()
public Object[] toArray()
toArray
in interface Collection
toArray
in interface List
public Object[] toArray(Object[] a)
toArray
in interface Collection
toArray
in interface List
public boolean removeAll(Collection c)
removeAll
in interface Collection
removeAll
in interface List
public boolean retainAll(Collection c)
retainAll
in interface Collection
retainAll
in interface List
public void clear()
clear
in interface Collection
clear
in interface List
Copyright © 2022. All rights reserved.