public class LongArray extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_CAPACITY |
| Constructor and Description |
|---|
LongArray()
Creates a sorted int array with a default initial capacity
|
LongArray(int capacity)
Creates an IntArray with a given initial capacity
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(int pos,
long x) |
void |
add(long x)
add value to the array
|
long[] |
array()
get the backing array.
|
boolean |
equals(Object obj) |
long |
get(int pos)
get element at position
|
int |
hashCode() |
boolean |
isEmpty() |
void |
set(int pos,
long x) |
int |
size() |
long[] |
toArray() |
String |
toString() |
static LongArray |
wrap(long... array)
Creates the IntArray with the backing array
|
public LongArray()
public LongArray(int capacity)
capacity - public static LongArray wrap(long... array)
array - public void add(long x)
x - - value to be addedpublic void add(int pos,
long x)
public long get(int pos)
pos - public boolean isEmpty()
public long[] toArray()
public int size()
public void set(int pos,
long x)
public long[] array()
Copyright © 2018 Space Applications Services. All rights reserved.