|
ref_send API 2.17 defensive programming in Java |
|||||||||
| 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<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.ImmutableArray |
|---|
equals |
| Methods inherited from class org.joe_e.array.ConstArray |
|---|
get, hashCode, iterator, length, toArray, toString |
| Methods inherited from class java.lang.Object |
|---|
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
java.lang.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 value
public static <T> PowerlessArray<T> array(T value1,
T value2)
ConstArray with two elements.
value1 - the first valuevalue2 - the second value
public static <T> PowerlessArray<T> array(T value1,
T value2,
T value3)
PowerlessArray with three elements.
value1 - the first valuevalue2 - the second valuevalue3 - the third value
public 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
java.lang.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
|
ref_send API 2.17 defensive programming in Java |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Copyright 1998-2009 Waterken Inc. under the terms of the MIT X license.