Package net.shibboleth.shared.collection
Class LazyList<ElementType>
java.lang.Object
net.shibboleth.shared.collection.LazyList<ElementType>
- Type Parameters:
ElementType- type of elements within the list
- All Implemented Interfaces:
Serializable,Iterable<ElementType>,Collection<ElementType>,List<ElementType>
@NotThreadSafe
public class LazyList<ElementType>
extends Object
implements List<ElementType>, Serializable
A list that is lazy initialized. This list takes very little memory when storing zero or one item.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate List<ElementType>Delegate list.private static final longSerial version UID. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(int index, ElementType element) booleanadd(ElementType item) booleanaddAll(int index, Collection<? extends ElementType> collection) booleanaddAll(Collection<? extends ElementType> collection) protected List<ElementType>Builds an appropriate delegate for this list.voidclear()booleanbooleancontainsAll(Collection<?> collections) booleanget(int index) inthashCode()intbooleanisEmpty()iterator()intlastIndexOf(Object element) listIterator(int index) remove(int index) booleanbooleanremoveAll(Collection<?> collection) booleanretainAll(Collection<?> collection) set(int index, ElementType element) intsize()subList(int fromIndex, int toIndex) Object[]toArray()<T> T[]toArray(T[] type) toString()Methods 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
replaceAll, sort, spliterator
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDSerial version UID.- See Also:
-
delegate
Delegate list.
-
-
Constructor Details
-
LazyList
public LazyList()
-
-
Method Details
-
add
- Specified by:
addin interfaceCollection<ElementType>- Specified by:
addin interfaceList<ElementType>
-
add
- Specified by:
addin interfaceList<ElementType>
-
addAll
- Specified by:
addAllin interfaceCollection<ElementType>- Specified by:
addAllin interfaceList<ElementType>
-
addAll
- Specified by:
addAllin interfaceList<ElementType>
-
clear
public void clear()- Specified by:
clearin interfaceCollection<ElementType>- Specified by:
clearin interfaceList<ElementType>
-
contains
- Specified by:
containsin interfaceCollection<ElementType>- Specified by:
containsin interfaceList<ElementType>
-
containsAll
- Specified by:
containsAllin interfaceCollection<ElementType>- Specified by:
containsAllin interfaceList<ElementType>
-
get
- Specified by:
getin interfaceList<ElementType>
-
indexOf
- Specified by:
indexOfin interfaceList<ElementType>
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceCollection<ElementType>- Specified by:
isEmptyin interfaceList<ElementType>
-
iterator
- Specified by:
iteratorin interfaceCollection<ElementType>- Specified by:
iteratorin interfaceIterable<ElementType>- Specified by:
iteratorin interfaceList<ElementType>
-
lastIndexOf
- Specified by:
lastIndexOfin interfaceList<ElementType>
-
listIterator
- Specified by:
listIteratorin interfaceList<ElementType>
-
listIterator
- Specified by:
listIteratorin interfaceList<ElementType>
-
remove
- Specified by:
removein interfaceCollection<ElementType>- Specified by:
removein interfaceList<ElementType>
-
remove
- Specified by:
removein interfaceList<ElementType>
-
removeAll
- Specified by:
removeAllin interfaceCollection<ElementType>- Specified by:
removeAllin interfaceList<ElementType>
-
retainAll
- Specified by:
retainAllin interfaceCollection<ElementType>- Specified by:
retainAllin interfaceList<ElementType>
-
set
- Specified by:
setin interfaceList<ElementType>
-
size
public int size()- Specified by:
sizein interfaceCollection<ElementType>- Specified by:
sizein interfaceList<ElementType>
-
subList
- Specified by:
subListin interfaceList<ElementType>
-
toArray
- Specified by:
toArrayin interfaceCollection<ElementType>- Specified by:
toArrayin interfaceList<ElementType>
-
toArray
public <T> T[] toArray(T[] type) - Specified by:
toArrayin interfaceCollection<ElementType>- Specified by:
toArrayin interfaceList<ElementType>
-
buildList
Builds an appropriate delegate for this list.- Returns:
- delegate for this list
-
toString
-
hashCode
public int hashCode()- Specified by:
hashCodein interfaceCollection<ElementType>- Specified by:
hashCodein interfaceList<ElementType>- Overrides:
hashCodein classObject
-
equals
- Specified by:
equalsin interfaceCollection<ElementType>- Specified by:
equalsin interfaceList<ElementType>- Overrides:
equalsin classObject
-