Package org.yamcs.utils
Class LongArray
java.lang.Object
org.yamcs.utils.LongArray
long array
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(int pos, long x) void
add
(long x) add value to the arraylong[]
array()
get the backing array.boolean
long
get
(int pos) get element at positionint
hashCode()
boolean
isEmpty()
void
set
(int pos, long x) int
size()
long[]
toArray()
toString()
static LongArray
wrap
(long... array) Creates the IntArray with the backing array
-
Field Details
-
DEFAULT_CAPACITY
public static int DEFAULT_CAPACITY
-
-
Constructor Details
-
LongArray
public LongArray()Creates a sorted int array with a default initial capacity -
LongArray
public LongArray(int capacity) Creates an IntArray with a given initial capacity- Parameters:
capacity
-
-
-
Method Details
-
wrap
Creates the IntArray with the backing array- Parameters:
array
-
-
add
public void add(long x) add value to the array- Parameters:
x
- - value to be added
-
add
public void add(int pos, long x) -
get
public long get(int pos) get element at position- Parameters:
pos
-- Returns:
-
isEmpty
public boolean isEmpty() -
toArray
public long[] toArray() -
size
public int size() -
set
public void set(int pos, long x) -
hashCode
public int hashCode() -
equals
-
array
public long[] array()get the backing array. It's length will be ≥ than the size of the array.- Returns:
-
toString
-