public class LongsArray extends Object implements LongsModifiable
Constructor and Description |
---|
LongsArray() |
LongsArray(int n) |
LongsArray(long[] a)
For efficiency, does not clone the array arg.
|
LongsArray(long[] a,
int n)
For efficiency, does not clone the array arg.
|
LongsArray(Longs xs)
Clones the sequence arg.
|
Modifier and Type | Method and Description |
---|---|
void |
append(long v) |
void |
append(long[] vs) |
void |
append(long[] vs,
int from,
int to) |
void |
append(LongBuffer vs) |
void |
append(LongBuffer vs,
int c) |
void |
append(Longs vs) |
void |
append(Longs vs,
int from,
int to) |
void |
clear() |
void |
compact() |
long[] |
copyOf() |
long[] |
copyOf(int i,
int c) |
void |
copyTo(int i,
long[] dest,
int iDest,
int c) |
void |
ensureCapacity(int minCapacity) |
long |
first() |
void |
insert(int i,
long v) |
void |
insert(int i,
long[] vs) |
void |
insert(int i,
long[] vs,
int from,
int to) |
void |
insert(int i,
LongBuffer vs) |
void |
insert(int i,
LongBuffer vs,
int c) |
void |
insert(int i,
Longs vs) |
void |
insert(int i,
Longs vs,
int from,
int to) |
boolean |
isEmpty() |
long |
last() |
int |
n()
Length of the sequence
|
static long[] |
newArray(int oldCapacity,
int minNewCapacity)
Creates a new array whose capacity is at least minNewCapacity, and at least
1.618 * oldCapacity, up to Integer.MAX_VALUE.
|
void |
prepend(long v) |
void |
prepend(long[] vs) |
void |
prepend(long[] vs,
int from,
int to) |
void |
prepend(LongBuffer vs) |
void |
prepend(LongBuffer vs,
int c) |
void |
prepend(Longs vs) |
void |
prepend(Longs vs,
int from,
int to) |
void |
prepForAppend(int c)
Makes room in this array for new values to be appended.
|
void |
prepForInsert(int i,
int c)
Makes room in this array for new values to be inserted.
|
void |
prepForPrepend(int c)
Makes room in this array for new values to be prepended.
|
void |
remove(long v)
Removes a single copy of the specified value.
|
void |
removeIndex(int index)
Remove value at index.
|
void |
removeRange(int from,
int to)
Removes values starting at index from (inclusive) to index to (exclusive).
|
void |
set(int i,
long v) |
void |
set(int i,
long[] vs) |
void |
set(int i,
long[] vs,
int from,
int to) |
long |
v(int i)
Value at index i
|
public LongsArray(long[] a)
public LongsArray(int n)
public LongsArray()
public LongsArray(long[] a, int n)
public LongsArray(Longs xs)
public long v(int i)
Longs
public int n()
Longs
public void copyTo(int i, long[] dest, int iDest, int c)
public void set(int i, long v)
set
in interface LongsModifiable
public void set(int i, long[] vs)
set
in interface LongsModifiable
public void set(int i, long[] vs, int from, int to)
set
in interface LongsModifiable
public void insert(int i, long v)
insert
in interface LongsModifiable
public void insert(int i, Longs vs)
insert
in interface LongsModifiable
public void insert(int i, Longs vs, int from, int to)
insert
in interface LongsModifiable
public void insert(int i, long[] vs)
insert
in interface LongsModifiable
public void insert(int i, long[] vs, int from, int to)
insert
in interface LongsModifiable
public void insert(int i, LongBuffer vs)
insert
in interface LongsModifiable
public void insert(int i, LongBuffer vs, int c)
insert
in interface LongsModifiable
public void prepForInsert(int i, int c)
this.a
on [i,i+c)
are undefined. Writing meaningful values to these indices is up to the
caller.i
- The index at which new values will be insertedc
- The count of new values that will be insertedpublic void prepend(long v)
prepend
in interface LongsModifiable
public void prepend(Longs vs)
prepend
in interface LongsModifiable
public void prepend(Longs vs, int from, int to)
prepend
in interface LongsModifiable
public void prepend(long[] vs)
prepend
in interface LongsModifiable
public void prepend(long[] vs, int from, int to)
prepend
in interface LongsModifiable
public void prepend(LongBuffer vs)
prepend
in interface LongsModifiable
public void prepend(LongBuffer vs, int c)
prepend
in interface LongsModifiable
public void prepForPrepend(int c)
this.a
on [0,c)
are undefined. Writing meaningful values to these indices is up to the
caller.c
- The count of new values that will be insertedpublic void append(long v)
append
in interface LongsModifiable
public void append(Longs vs)
append
in interface LongsModifiable
public void append(Longs vs, int from, int to)
append
in interface LongsModifiable
public void append(long[] vs)
append
in interface LongsModifiable
public void append(long[] vs, int from, int to)
append
in interface LongsModifiable
public void append(LongBuffer vs)
append
in interface LongsModifiable
public void append(LongBuffer vs, int c)
append
in interface LongsModifiable
public void prepForAppend(int c)
this.a
on [this.n-c,this.n)
are undefined. Writing meaningful values to these indices is up to the
caller.c
- The count of new values that will be appendedpublic void remove(long v)
LongsModifiable
remove
in interface LongsModifiable
public void removeRange(int from, int to)
LongsModifiable
removeRange
in interface LongsModifiable
public void removeIndex(int index)
LongsModifiable
removeIndex
in interface LongsModifiable
public void clear()
clear
in interface LongsModifiable
public void ensureCapacity(int minCapacity)
ensureCapacity
in interface LongsModifiable
public void compact()
compact
in interface LongsModifiable
public static long[] newArray(int oldCapacity, int minNewCapacity)
Copyright © 2013 Metron, Inc.. All rights reserved.