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()booleanequals(@Nullable Object o)Tget(int index)inthashCode()Tset(int index, T element)intsize()-
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:
sizein interfaceCollection<T>- Specified by:
sizein interfaceList<T>- Specified by:
sizein classAbstractCollection<T>
-
clone
public ArrayStorage<T> clone()
-
equals
public boolean equals(@Nullable Object o)
- Specified by:
equalsin interfaceCollection<T>- Specified by:
equalsin interfaceList<T>- Overrides:
equalsin classAbstractList<T>
-
hashCode
public int hashCode()
- Specified by:
hashCodein interfaceCollection<T>- Specified by:
hashCodein interfaceList<T>- Overrides:
hashCodein classAbstractList<T>
-
-