|
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<java.lang.Float>
org.joe_e.array.FloatArray
public final class FloatArray
An immutable array of float.
| Nested Class Summary | |
|---|---|
static class |
FloatArray.Builder
A FloatArray factory. |
| Method Summary | ||
|---|---|---|
static FloatArray |
array()
Construct an empty FloatArray |
|
static FloatArray |
array(float... floats)
Constructs an array of floats. |
|
static FloatArray |
array(float value)
Construct a FloatArray with one element. |
|
static FloatArray |
array(float value1,
float value2)
Construct a FloatArray with two elements. |
|
static FloatArray |
array(float value1,
float value2,
float value3)
Construct a FloatArray with three elements. |
|
static FloatArray |
array(float value1,
float value2,
float value3,
float value4)
Construct a FloatArray with four elements. |
|
static FloatArray.Builder |
builder()
Get a FloatArray.Builder. |
|
static FloatArray.Builder |
builder(int estimate)
Get a FloatArray.Builder. |
|
boolean |
equals(java.lang.Object other)
Test for equality with another object |
|
java.lang.Float |
get(int i)
Creates a Float for a specified float. |
|
float |
getFloat(int i)
Gets the float 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 |
|
float[] |
toFloatArray()
Creates a mutable copy of the float array |
|
java.lang.String |
toString()
Return a string representation of the array |
|
FloatArray |
with(float newFloat)
Creates a FloatArray with an appended float. |
|
FloatArray |
with(java.lang.Float newFloat)
Creates a FloatArray |
|
FloatArray |
without(int i)
Return a new FloatArray 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 |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Method Detail |
|---|
public static FloatArray array(float... floats)
floats.
floats - each elementpublic static FloatArray array()
FloatArray
public static FloatArray array(float value)
FloatArray with one element.
value - the value
public static FloatArray array(float value1,
float value2)
FloatArray with two elements.
value1 - the first valuevalue2 - the second value
public static FloatArray array(float value1,
float value2,
float value3)
FloatArray with three elements.
value1 - the first valuevalue2 - the second valuevalue3 - the third value
public static FloatArray array(float value1,
float value2,
float value3,
float value4)
FloatArray with four elements.
value1 - the first valuevalue2 - the second valuevalue3 - the third valuevalue4 - the fourth valuepublic boolean equals(java.lang.Object other)
equals in class ImmutableArray<java.lang.Float>ConstArray with the same
contents as this arraypublic int hashCode()
Arrays.hashCode(Object[]) called on a Java array
containing the same elements.
hashCode in interface SelflesshashCode in class ConstArray<java.lang.Float>public java.lang.String toString()
toString in class ConstArray<java.lang.Float>public int length()
length in class ConstArray<java.lang.Float>public java.lang.Float get(int i)
Float for a specified float.
get in class ConstArray<java.lang.Float>i - position of the element to return
java.lang.ArrayIndexOutOfBoundsException - i is out of boundspublic <T> T[] toArray(T[] prototype)
toArray in class ConstArray<java.lang.Float>prototype - prototype of the array to copy into
ConstArray
of the same type as prototype
java.lang.ArrayStoreException - if an element cannot be stored in the arraypublic FloatArray with(java.lang.Float newFloat)
FloatArray with an appended Float.
- Overrides:
with in class PowerlessArray<java.lang.Float>
- Parameters:
newFloat - the element to append
- Returns:
- the new array
- Throws:
java.lang.NullPointerException - newFloat is null
public float getFloat(int i)
float at a specified position.
i - position of the element to return
java.lang.ArrayIndexOutOfBoundsException - i is out of boundspublic float[] toFloatArray()
float array
public FloatArray with(float newFloat)
FloatArray with an appended float.
newFloat - the element to appendpublic FloatArray without(int i)
FloatArray that contains the same elements
as this one excluding the element at a specified index
without in class PowerlessArray<java.lang.Float>i - the index of the element to exclude
public static FloatArray.Builder builder()
FloatArray.Builder. This is equivalent to the
constructor.
public static FloatArray.Builder builder(int estimate)
FloatArray.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.