Class SparseArrayList<T>
java.lang.Object
java.util.AbstractCollection<T>
java.util.AbstractList<T>
ubic.gemma.core.datastructure.sparse.SparseArrayList<T>
- Type Parameters:
T- the type of elements in the array
- All Implemented Interfaces:
Iterable<T>,Collection<T>,List<T>,SparseList<T>
A sparse array backed by an
ArrayList.
This array uses a common encoding for sparse encoding such as CSR and CSC. Data points are stored in two vectors: elements and indices. To make operations efficient, the indices are kept in-order.
- Author:
- poirigui
-
Field Summary
Fields inherited from class java.util.AbstractList
modCount -
Constructor Summary
ConstructorsConstructorDescriptionCreate an empty sparse array.SparseArrayList(Collection<T> collection) Create a new sparse array from a given collection,nullis used as default value.SparseArrayList(Collection<T> collection, T defaultValue) SparseArrayList(List<T> array, int[] indices, int numberOfElements) Create a new sparse array,nullis used as default value.SparseArrayList(List<T> array, int[] indices, int numberOfElements, T defaultValue) -
Method Summary
Methods inherited from class java.util.AbstractList
add, add, addAll, clear, hashCode, iterator, listIterator, listIterator, remove, removeRange, set, subListMethods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, streamMethods inherited from interface java.util.List
add, add, addAll, addAll, clear, contains, containsAll, hashCode, isEmpty, iterator, listIterator, listIterator, remove, remove, removeAll, replaceAll, retainAll, set, sort, spliterator, subList, toArray, toArray
-
Constructor Details
-
SparseArrayList
-
SparseArrayList
Create a new sparse array from a given collection,nullis used as default value. -
SparseArrayList
-
SparseArrayList
Create a new sparse array,nullis used as default value. -
SparseArrayList
public SparseArrayList()Create an empty sparse array.
-
-
Method Details
-
get
-
storageSize
public int storageSize()Description copied from interface:SparseListThe number of elements actually stored.- Specified by:
storageSizein interfaceSparseList<T>
-
size
public int size()- Specified by:
sizein interfaceCollection<T>- Specified by:
sizein interfaceList<T>- Specified by:
sizein classAbstractCollection<T>
-
indexOf
-
lastIndexOf
- Specified by:
lastIndexOfin interfaceList<T>- Overrides:
lastIndexOfin classAbstractList<T>
-
equals
- Specified by:
equalsin interfaceCollection<T>- Specified by:
equalsin interfaceList<T>- Overrides:
equalsin classAbstractList<T>
-