|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.joe_e.array.ConstArray<E>
org.joe_e.array.ImmutableArray<E>
org.joe_e.array.PowerlessArray<Boolean>
org.joe_e.array.BooleanArray
public final class BooleanArray
An immutable array of boolean.
| Nested Class Summary | |
|---|---|
static class |
BooleanArray.Builder
A BooleanArray factory. |
| Method Summary | ||
|---|---|---|
static BooleanArray |
array()
Construct an empty BooleanArray |
|
static BooleanArray |
array(boolean... booleans)
Constructs an array of booleans. |
|
static BooleanArray |
array(boolean value)
Construct a BooleanArray with one element. |
|
static BooleanArray |
array(boolean value1,
boolean value2)
Construct a BooleanArray with two elements. |
|
static BooleanArray |
array(boolean value1,
boolean value2,
boolean value3)
Construct a BooleanArray with three elements. |
|
static BooleanArray |
array(boolean value1,
boolean value2,
boolean value3,
boolean value4)
Construct a BooleanArray with four elements. |
|
static BooleanArray.Builder |
builder()
Get a BooleanArray.Builder. |
|
static BooleanArray.Builder |
builder(int estimate)
Get a BooleanArray.Builder. |
|
boolean |
equals(Object other)
Test for equality with another object |
|
Boolean |
get(int i)
Creates a Boolean for a specified boolean. |
|
boolean |
getBoolean(int i)
Gets the boolean at a specified position. |
|
int |
hashCode()
Computes a digest of the array for hashing. |
|
int |
length()
Gets the length of the array. |
|
|
toArray(T[] prototype)
Return a mutable copy of the array |
|
boolean[] |
toBooleanArray()
Creates a mutable copy of the boolean array |
|
String |
toString()
Return a string representation of the array |
|
BooleanArray |
with(boolean newBoolean)
Creates a BooleanArray with an appended boolean. |
|
BooleanArray |
with(Boolean newBoolean)
Creates a BooleanArray |
|
BooleanArray |
without(int i)
Return a new BooleanArray that contains the same elements
as this one excluding the element at a specified index |
|
| Methods inherited from class org.joe_e.array.PowerlessArray |
|---|
array |
| Methods inherited from class org.joe_e.array.ConstArray |
|---|
iterator |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Method Detail |
|---|
public static BooleanArray array(boolean... booleans)
booleans.
booleans - each elementpublic static BooleanArray array()
BooleanArray
public static BooleanArray array(boolean value)
BooleanArray with one element.
value - the value
public static BooleanArray array(boolean value1,
boolean value2)
BooleanArray with two elements.
value1 - the first valuevalue2 - the second value
public static BooleanArray array(boolean value1,
boolean value2,
boolean value3)
BooleanArray with three elements.
value1 - the first valuevalue2 - the second valuevalue3 - the third value
public static BooleanArray array(boolean value1,
boolean value2,
boolean value3,
boolean value4)
BooleanArray with four elements.
value1 - the first valuevalue2 - the second valuevalue3 - the third valuevalue4 - the fourth valuepublic boolean equals(Object other)
equals in class ConstArray<Boolean>other - the reference object with which to compare.
ConstArray with the same
contents as this arrayObject.hashCode(),
HashMappublic int hashCode()
Arrays.hashCode(Object[]) called on a Java array
containing the same elements.
hashCode in interface SelflesshashCode in class ConstArray<Boolean>Object.equals(java.lang.Object),
System.identityHashCode(java.lang.Object)public String toString()
toString in class ConstArray<Boolean>public int length()
length in class ConstArray<Boolean>public Boolean get(int i)
Boolean for a specified boolean.
get in class ConstArray<Boolean>i - position of the element to return
ArrayIndexOutOfBoundsException - i is out of boundspublic <T> T[] toArray(T[] prototype)
toArray in class ConstArray<Boolean>prototype - prototype of the array to copy into
ConstArray
of the same type as prototype
ArrayStoreException - if an element cannot be stored in the arraypublic BooleanArray with(Boolean newBoolean)
BooleanArray with an appended Boolean.
- Overrides:
with in class PowerlessArray<Boolean>
- Parameters:
newBoolean - the element to append
- Returns:
- the new array
- Throws:
NullPointerException - newBoolean is null
public boolean getBoolean(int i)
boolean at a specified position.
i - position of the element to return
ArrayIndexOutOfBoundsException - i is out of boundspublic boolean[] toBooleanArray()
boolean array
public BooleanArray with(boolean newBoolean)
BooleanArray with an appended boolean.
newBoolean - the element to appendpublic BooleanArray without(int i)
BooleanArray that contains the same elements
as this one excluding the element at a specified index
without in class PowerlessArray<Boolean>i - the index of the element to exclude
public static BooleanArray.Builder builder()
BooleanArray.Builder. This is equivalent to the
constructor.
public static BooleanArray.Builder builder(int estimate)
BooleanArray.Builder. This is equivalent to the
constructor.
estimate - estimated array length
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||