public class IntsArray extends Object implements IntsModifiable
Constructor and Description |
---|
IntsArray() |
IntsArray(int n) |
IntsArray(int[] a)
For efficiency, does not clone the array arg.
|
IntsArray(int[] a,
int n)
For efficiency, does not clone the array arg.
|
IntsArray(Ints xs)
Clones the sequence arg.
|
Modifier and Type | Method and Description |
---|---|
void |
append(int v) |
void |
append(int[] vs) |
void |
append(int[] vs,
int from,
int to) |
void |
append(IntBuffer vs) |
void |
append(IntBuffer vs,
int c) |
void |
append(Ints vs) |
void |
append(Ints vs,
int from,
int to) |
void |
clear() |
void |
compact() |
int[] |
copyOf() |
int[] |
copyOf(int i,
int c) |
void |
copyTo(IntBuffer dest) |
void |
copyTo(int i,
int[] dest,
int iDest,
int c) |
void |
copyTo(int i,
IntBuffer dest,
int c) |
void |
ensureCapacity(int minCapacity) |
int |
first() |
void |
insert(int i,
int v) |
void |
insert(int i,
int[] vs) |
void |
insert(int i,
int[] vs,
int from,
int to) |
void |
insert(int i,
IntBuffer vs) |
void |
insert(int i,
IntBuffer vs,
int c) |
void |
insert(int i,
Ints vs) |
void |
insert(int i,
Ints vs,
int from,
int to) |
boolean |
isEmpty() |
int |
last() |
int |
n()
Length of the sequence
|
static int[] |
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(int v) |
void |
prepend(int[] vs) |
void |
prepend(int[] vs,
int from,
int to) |
void |
prepend(IntBuffer vs) |
void |
prepend(IntBuffer vs,
int c) |
void |
prepend(Ints vs) |
void |
prepend(Ints 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(int 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,
int v) |
void |
set(int i,
int[] vs) |
void |
set(int i,
int[] vs,
int from,
int to) |
int |
v(int i)
Value at index i
|
public IntsArray(int[] a)
public IntsArray(int n)
public IntsArray()
public IntsArray(int[] a, int n)
public IntsArray(Ints xs)
public int v(int i)
Ints
public int n()
Ints
public void copyTo(int i, int[] dest, int iDest, int c)
public void set(int i, int v)
set
in interface IntsModifiable
public void set(int i, int[] vs)
set
in interface IntsModifiable
public void set(int i, int[] vs, int from, int to)
set
in interface IntsModifiable
public void insert(int i, int v)
insert
in interface IntsModifiable
public void insert(int i, Ints vs)
insert
in interface IntsModifiable
public void insert(int i, Ints vs, int from, int to)
insert
in interface IntsModifiable
public void insert(int i, int[] vs)
insert
in interface IntsModifiable
public void insert(int i, int[] vs, int from, int to)
insert
in interface IntsModifiable
public void insert(int i, IntBuffer vs)
insert
in interface IntsModifiable
public void insert(int i, IntBuffer vs, int c)
insert
in interface IntsModifiable
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(int v)
prepend
in interface IntsModifiable
public void prepend(Ints vs)
prepend
in interface IntsModifiable
public void prepend(Ints vs, int from, int to)
prepend
in interface IntsModifiable
public void prepend(int[] vs)
prepend
in interface IntsModifiable
public void prepend(int[] vs, int from, int to)
prepend
in interface IntsModifiable
public void prepend(IntBuffer vs)
prepend
in interface IntsModifiable
public void prepend(IntBuffer vs, int c)
prepend
in interface IntsModifiable
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(int v)
append
in interface IntsModifiable
public void append(Ints vs)
append
in interface IntsModifiable
public void append(Ints vs, int from, int to)
append
in interface IntsModifiable
public void append(int[] vs)
append
in interface IntsModifiable
public void append(int[] vs, int from, int to)
append
in interface IntsModifiable
public void append(IntBuffer vs)
append
in interface IntsModifiable
public void append(IntBuffer vs, int c)
append
in interface IntsModifiable
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(int v)
IntsModifiable
remove
in interface IntsModifiable
public void removeRange(int from, int to)
IntsModifiable
removeRange
in interface IntsModifiable
public void removeIndex(int index)
IntsModifiable
removeIndex
in interface IntsModifiable
public void clear()
clear
in interface IntsModifiable
public void ensureCapacity(int minCapacity)
ensureCapacity
in interface IntsModifiable
public void compact()
compact
in interface IntsModifiable
public static int[] newArray(int oldCapacity, int minNewCapacity)
Copyright © 2016 Metron, Inc.. All rights reserved.