Package ubic.gemma.model.util
Class SparseRangeArrayList<T>
java.lang.Object
java.util.AbstractCollection<T>
java.util.AbstractList<T>
ubic.gemma.model.util.SparseRangeArrayList<T>
- All Implemented Interfaces:
Iterable<T>
,Collection<T>
,List<T>
,SparseList<T>
A sparse range array is a data structure that efficiently stores arrays of repeated elements by encoding their
starting offsets.
For example, a sequence of characters AAAAABBBBCC
is stored as ABC
with the following offsets
0, 5, 9
.
- Author:
- poirigui
- See Also:
-
Field Summary
Fields inherited from class java.util.AbstractList
modCount
-
Constructor Summary
ConstructorsConstructorDescriptionCreate an empty sparse range array.SparseRangeArrayList
(Collection<T> collection) SparseRangeArrayList
(List<T> array, int[] offsets, int numberOfElements) -
Method Summary
Methods inherited from class java.util.AbstractList
add, add, addAll, clear, hashCode, iterator, listIterator, listIterator, remove, removeRange, set, 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
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream
Methods 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
-
SparseRangeArrayList
-
SparseRangeArrayList
-
SparseRangeArrayList
public SparseRangeArrayList()Create an empty sparse range array.
-
-
Method Details
-
get
-
storageSize
public int storageSize()Description copied from interface:SparseList
The number of elements actually stored.- Specified by:
storageSize
in interfaceSparseList<T>
-
size
public int size()- Specified by:
size
in interfaceCollection<T>
- Specified by:
size
in interfaceList<T>
- Specified by:
size
in classAbstractCollection<T>
-
indexOf
-
lastIndexOf
- Specified by:
lastIndexOf
in interfaceList<T>
- Overrides:
lastIndexOf
in classAbstractList<T>
-
equals
- Specified by:
equals
in interfaceCollection<T>
- Specified by:
equals
in interfaceList<T>
- Overrides:
equals
in classAbstractList<T>
-