|
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.Object org.joe_e.array.ConstArray<E> org.joe_e.array.ImmutableArray<E>
E
- the element type of objects contained in the arraypublic class ImmutableArray<E>
An immutable array containing immutable objects.
Nested Class Summary | |
---|---|
static class |
ImmutableArray.Builder<E>
An ImmutableArray factory. |
Method Summary | ||
---|---|---|
static
|
array()
Construct an empty ConstArray . |
|
static
|
array(T... values)
Construct a ImmutableArray . |
|
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 ImmutableArray with three elements. |
|
static
|
array(T value1,
T value2,
T value3,
T value4)
Construct an ImmutableArray with four elements. |
|
static
|
builder()
Get an ImmutableArray.Builder . |
|
static
|
builder(int estimate)
Get an ImmutableArray.Builder . |
|
boolean |
equals(java.lang.Object x)
Test for equality with another object. |
|
ImmutableArray<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. |
|
ImmutableArray<E> |
without(int i)
Return a new ImmutableArray that contains the same elements
as this one excluding the element at a specified index |
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> ImmutableArray<T> array(T... values)
ImmutableArray
.
values
- each value
java.lang.ClassCastException
- if the runtime component type of
values
is not immutable in the overlay type systempublic static <T> ImmutableArray<T> array()
ConstArray
.
public static <T> ImmutableArray<T> array(T value)
ConstArray
with one element.
value
- the valuepublic static <T> ImmutableArray<T> array(T value1, T value2)
ConstArray
with two elements.
value1
- the first valuevalue2
- the second valuepublic static <T> ImmutableArray<T> array(T value1, T value2, T value3)
ImmutableArray
with three elements.
value1
- the first valuevalue2
- the second valuevalue3
- the third valuepublic static <T> ImmutableArray<T> array(T value1, T value2, T value3, T value4)
ImmutableArray
with four elements.
value1
- the first valuevalue2
- the second valuevalue3
- the third valuevalue4
- the fourth valuepublic boolean equals(java.lang.Object x)
ConstArray
equals
in class ConstArray<E>
public ImmutableArray<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 ConstArray<E>
newE
- an element to add
java.lang.ClassCastException
- if newE
is not immutablepublic ImmutableArray<E> without(int i)
ImmutableArray
that contains the same elements
as this one excluding the element at a specified index
without
in class ConstArray<E>
i
- the index of the element to exclude
public static <E> ImmutableArray.Builder<E> builder()
ImmutableArray.Builder
. This is equivalent to the
constructor.
public static <E> ImmutableArray.Builder<E> builder(int estimate)
ImmutableArray.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.