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