|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.joe_e.array.ConstArray<E> org.joe_e.array.ImmutableArray<E> org.joe_e.array.PowerlessArray<E>
E
- the element type of objects contained in the arraypublic class PowerlessArray<E>
An immutable array containing powerless objects.
Nested Class Summary | |
---|---|
static class |
PowerlessArray.Builder<E>
A PowerlessArray factory. |
Method Summary | ||
---|---|---|
static
|
array()
Construct an empty ConstArray . |
|
static
|
array(T... values)
Construct a PowerlessArray . |
|
static
|
array(T value)
Construct a ConstArray with one element. |
|
static
|
array(T value1,
T value2)
Construct a ConstArray with two elements. |
|
static
|
array(T value1,
T value2,
T value3)
Construct an PowerlessArray with three elements. |
|
static
|
array(T value1,
T value2,
T value3,
T value4)
Construct an PowerlessArray with four elements. |
|
static
|
builder()
Get a PowerlessArray.Builder . |
|
static
|
builder(int estimate)
Get a PowerlessArray.Builder . |
|
PowerlessArray<E> |
with(E newE)
Return a new PowerlessArray that contains the same elements
as this one but with a new element added to the end. |
|
PowerlessArray<E> |
without(int i)
Return a new PowerlessArray that contains the same elements
as this one excluding the element at a specified index |
Methods inherited from class org.joe_e.array.ConstArray |
---|
equals, get, hashCode, iterator, length, toArray, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public static <T> PowerlessArray<T> array(T... values)
PowerlessArray
. The type will be
values
- each value, or an array of values
ClassCastException
- if the runtime component type of
values
is not powerless in the overlay type systempublic static <T> PowerlessArray<T> array()
ConstArray
.
public static <T> PowerlessArray<T> array(T value)
ConstArray
with one element.
value
- the valuepublic static <T> PowerlessArray<T> array(T value1, T value2)
ConstArray
with two elements.
value1
- the first valuevalue2
- the second valuepublic static <T> PowerlessArray<T> array(T value1, T value2, T value3)
PowerlessArray
with three elements.
value1
- the first valuevalue2
- the second valuevalue3
- the third valuepublic static <T> PowerlessArray<T> array(T value1, T value2, T value3, T value4)
PowerlessArray
with four elements.
value1
- the first valuevalue2
- the second valuevalue3
- the third valuevalue4
- the fourth valuepublic PowerlessArray<E> with(E newE)
PowerlessArray
that contains the same elements
as this one but with a new element added to the end.
with
in class ImmutableArray<E>
newE
- an element to add
ClassCastException
- if newE
is not powerlesspublic PowerlessArray<E> without(int i)
PowerlessArray
that contains the same elements
as this one excluding the element at a specified index
without
in class ImmutableArray<E>
i
- the index of the element to exclude
public static <E> PowerlessArray.Builder<E> builder()
PowerlessArray.Builder
. This is equivalent to the
constructor.
public static <E> PowerlessArray.Builder<E> builder(int estimate)
PowerlessArray.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 |