Class ArrayStorage<T>
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<T>
-
- net.automatalib.common.smartcollection.ArrayStorage<T>
-
- Type Parameters:
T
- the type of stored elements
- All Implemented Interfaces:
Cloneable
,Iterable<T>
,Collection<T>
,List<T>
,RandomAccess
public final class ArrayStorage<T> extends AbstractList<T> implements RandomAccess, Cloneable
A thin wrapper around a simpleObject[]
array. Mainly used (and useful) for heavily generic and array-based data storage. Extends/Implements some convenient classes/interfaces.
-
-
Field Summary
-
Fields inherited from class java.util.AbstractList
modCount
-
-
Constructor Summary
Constructors Constructor Description ArrayStorage(int size)
ArrayStorage(int size, Supplier<T> supplier)
ArrayStorage(Collection<? extends T> collection)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ArrayStorage<T>
clone()
boolean
equals(@Nullable Object o)
T
get(int index)
int
hashCode()
T
set(int index, T element)
int
size()
-
Methods inherited from class java.util.AbstractList
add, add, addAll, clear, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, subList
-
Methods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream
-
Methods inherited from interface java.util.List
addAll, contains, containsAll, isEmpty, remove, removeAll, replaceAll, retainAll, sort, spliterator, toArray, toArray
-
-
-
-
Constructor Detail
-
ArrayStorage
public ArrayStorage(int size)
-
ArrayStorage
public ArrayStorage(Collection<? extends T> collection)
-
-
Method Detail
-
get
public T get(int index)
-
size
public int size()
- Specified by:
size
in interfaceCollection<T>
- Specified by:
size
in interfaceList<T>
- Specified by:
size
in classAbstractCollection<T>
-
clone
public ArrayStorage<T> clone()
-
equals
public boolean equals(@Nullable Object o)
- Specified by:
equals
in interfaceCollection<T>
- Specified by:
equals
in interfaceList<T>
- Overrides:
equals
in classAbstractList<T>
-
hashCode
public int hashCode()
- Specified by:
hashCode
in interfaceCollection<T>
- Specified by:
hashCode
in interfaceList<T>
- Overrides:
hashCode
in classAbstractList<T>
-
-