- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<BaseType>
-
- org.scijava.collections.AbstractPrimitiveArray<long[],Long>
-
- org.scijava.collections.LongArray
-
- All Implemented Interfaces:
Iterable<Long>,Collection<Long>,List<Long>,PrimitiveArray<long[],Long>
public class LongArray extends AbstractPrimitiveArray<long[],Long>
An extensible array oflongelements.- Author:
- Johannes Schindelin, Curtis Rueden
-
-
Field Summary
-
Fields inherited from class java.util.AbstractList
modCount
-
-
Constructor Summary
Constructors Constructor Description LongArray()Constructs an extensible array of longs, backed by a fixed-size array.LongArray(int size)Constructs an extensible array of longs, backed by a fixed-size array.LongArray(long[] array)Constructs an extensible array of longs, backed by the given fixed-size array.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(int index, Long element)booleanaddAll(int index, Collection<? extends Long> c)voidaddValue(int index, long value)voidaddValue(long value)booleancontains(long value)booleancontains(Object o)booleancontainsAll(Collection<?> c)LongdefaultValue()Longget(int index)long[]getArray()Gets the fixed-size array backing this instance.longgetValue(int index)intindexOf(long value)intindexOf(Object o)intlastIndexOf(long value)intlastIndexOf(Object o)booleanremove(Object o)booleanremoveAll(Collection<?> c)booleanremoveValue(long value)Longset(int index, Long element)voidsetArray(long[] array)Sets the fixed-size array backing this instance.longsetValue(int index, long value)-
Methods inherited from class org.scijava.collections.AbstractPrimitiveArray
capacity, checkBounds, clear, copyArray, delete, ensureCapacity, getMaximumGrowth, insert, remove, setMaximumGrowth, setSize, size
-
Methods inherited from class java.util.AbstractList
add, equals, hashCode, iterator, listIterator, listIterator, removeRange, subList
-
Methods inherited from class java.util.AbstractCollection
addAll, isEmpty, 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, toArray
-
Methods inherited from interface java.util.List
add, addAll, equals, hashCode, isEmpty, iterator, listIterator, listIterator, replaceAll, retainAll, sort, spliterator, subList, toArray, toArray
-
-
-
-
Constructor Detail
-
LongArray
public LongArray()
Constructs an extensible array of longs, backed by a fixed-size array.
-
LongArray
public LongArray(int size)
Constructs an extensible array of longs, backed by a fixed-size array.- Parameters:
size- the initial size
-
LongArray
public LongArray(long[] array)
Constructs an extensible array of longs, backed by the given fixed-size array.- Parameters:
array- the array to wrap
-
-
Method Detail
-
addValue
public void addValue(long value)
-
removeValue
public boolean removeValue(long value)
-
getValue
public long getValue(int index)
-
setValue
public long setValue(int index, long value)
-
addValue
public void addValue(int index, long value)
-
indexOf
public int indexOf(long value)
-
lastIndexOf
public int lastIndexOf(long value)
-
contains
public boolean contains(long value)
-
getArray
public long[] getArray()
Description copied from interface:PrimitiveArrayGets the fixed-size array backing this instance.- Returns:
- the backing array
-
setArray
public void setArray(long[] array)
Description copied from interface:PrimitiveArraySets the fixed-size array backing this instance.- Parameters:
array- the new backing array
-
get
public Long get(int index)
-
add
public void add(int index, Long element)
-
indexOf
public int indexOf(Object o)
-
lastIndexOf
public int lastIndexOf(Object o)
- Specified by:
lastIndexOfin interfaceList<Long>- Overrides:
lastIndexOfin classAbstractList<Long>
-
contains
public boolean contains(Object o)
- Specified by:
containsin interfaceCollection<Long>- Specified by:
containsin interfaceList<Long>- Overrides:
containsin classAbstractCollection<Long>
-
remove
public boolean remove(Object o)
- Specified by:
removein interfaceCollection<Long>- Specified by:
removein interfaceList<Long>- Overrides:
removein classAbstractCollection<Long>
-
containsAll
public boolean containsAll(Collection<?> c)
- Specified by:
containsAllin interfaceCollection<Long>- Specified by:
containsAllin interfaceList<Long>- Overrides:
containsAllin classAbstractCollection<Long>
-
addAll
public boolean addAll(int index, Collection<? extends Long> c)
-
removeAll
public boolean removeAll(Collection<?> c)
- Specified by:
removeAllin interfaceCollection<Long>- Specified by:
removeAllin interfaceList<Long>- Overrides:
removeAllin classAbstractCollection<Long>
-
defaultValue
public Long defaultValue()
-
-