org.scijava.util
Class LongArray

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<BaseType>
          extended by org.scijava.util.AbstractPrimitiveArray<long[],Long>
              extended by org.scijava.util.LongArray
All Implemented Interfaces:
Iterable<Long>, Collection<Long>, List<Long>, PrimitiveArray<long[],Long>, Sizable

public class LongArray
extends AbstractPrimitiveArray<long[],Long>

An extensible array of long elements.

Author:
Johannes Schindelin, Curtis Rueden

Field Summary
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
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
 void add(int index, Long element)
           
 boolean addAll(int index, Collection<? extends Long> c)
           
 void addValue(int index, long value)
           
 void addValue(long value)
           
 boolean contains(long value)
           
 boolean contains(Object o)
           
 boolean containsAll(Collection<?> c)
           
 Long defaultValue()
           
 Long get(int index)
           
 long[] getArray()
          Gets the fixed-size array backing this instance.
 long getValue(int index)
           
 int indexOf(long value)
           
 int indexOf(Object o)
           
 int lastIndexOf(long value)
           
 int lastIndexOf(Object o)
           
 boolean remove(Object o)
           
 boolean removeAll(Collection<?> c)
           
 boolean removeValue(long value)
           
 Long set(int index, Long element)
           
 void setArray(long[] array)
          Sets the fixed-size array backing this instance.
 long setValue(int index, long value)
           
 
Methods inherited from class org.scijava.util.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.List
add, addAll, equals, hashCode, isEmpty, iterator, listIterator, listIterator, retainAll, 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: PrimitiveArray
Gets the fixed-size array backing this instance.

Returns:
the backing array

setArray

public void setArray(long[] array)
Description copied from interface: PrimitiveArray
Sets the fixed-size array backing this instance.

Parameters:
array - the new backing array

get

public Long get(int index)
Specified by:
get in interface List<Long>
Specified by:
get in class AbstractList<Long>

set

public Long set(int index,
                Long element)
Specified by:
set in interface List<Long>
Specified by:
set in class AbstractPrimitiveArray<long[],Long>

add

public void add(int index,
                Long element)
Specified by:
add in interface List<Long>
Specified by:
add in class AbstractPrimitiveArray<long[],Long>

indexOf

public int indexOf(Object o)
Specified by:
indexOf in interface List<Long>
Overrides:
indexOf in class AbstractList<Long>

lastIndexOf

public int lastIndexOf(Object o)
Specified by:
lastIndexOf in interface List<Long>
Overrides:
lastIndexOf in class AbstractList<Long>

contains

public boolean contains(Object o)
Specified by:
contains in interface Collection<Long>
Specified by:
contains in interface List<Long>
Overrides:
contains in class AbstractCollection<Long>

remove

public boolean remove(Object o)
Specified by:
remove in interface Collection<Long>
Specified by:
remove in interface List<Long>
Overrides:
remove in class AbstractCollection<Long>

containsAll

public boolean containsAll(Collection<?> c)
Specified by:
containsAll in interface Collection<Long>
Specified by:
containsAll in interface List<Long>
Overrides:
containsAll in class AbstractCollection<Long>

addAll

public boolean addAll(int index,
                      Collection<? extends Long> c)
Specified by:
addAll in interface List<Long>
Overrides:
addAll in class AbstractList<Long>

removeAll

public boolean removeAll(Collection<?> c)
Specified by:
removeAll in interface Collection<Long>
Specified by:
removeAll in interface List<Long>
Overrides:
removeAll in class AbstractCollection<Long>

defaultValue

public Long defaultValue()


Copyright © 2009–2014 SciJava. All rights reserved.