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