Package blbutil
Class FloatArray
- java.lang.Object
-
- blbutil.FloatArray
-
public class FloatArray extends java.lang.ObjectClassFloatArrayrepresents an immutable list of float floating point values.
-
-
Constructor Summary
Constructors Constructor Description FloatArray(double[] values)Constructs anFloatArrayobject with the specified values.FloatArray(float[] values)Constructs anFloatArrayobject with the specified values.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description floatget(int index)Returns the float at the specified position in this list.booleanisEmpty()Returnstrueif this list has no elements, and returnsfalseotherwise.intsize()Returns the number of elements in this list.float[]toArray()Returns an integer array containing the sequence of elements in this list.java.lang.StringtoString()Returns a string representation of this list that is obtained by callingjava.util.Arrays.toString(this.toArray()).
-
-
-
Constructor Detail
-
FloatArray
public FloatArray(float[] values)
Constructs anFloatArrayobject with the specified values.- Parameters:
values- the list of floating point values- Throws:
java.lang.NullPointerException- ifvalues == null
-
FloatArray
public FloatArray(double[] values)
Constructs anFloatArrayobject with the specified values.- Parameters:
values- the list of floating point values- Throws:
java.lang.NullPointerException- ifvalues == null
-
-
Method Detail
-
get
public float get(int index)
Returns the float at the specified position in this list.- Parameters:
index- the index of the returned float- Returns:
- the float at the specified position in this list
- Throws:
java.lang.IndexOutOfBoundsException- ifindex < 0 || index >= size
-
size
public int size()
Returns the number of elements in this list.- Returns:
- the number of elements in this list
-
isEmpty
public boolean isEmpty()
Returnstrueif this list has no elements, and returnsfalseotherwise.- Returns:
trueif this list has no elements, and returnsfalseotherwise
-
toArray
public float[] toArray()
Returns an integer array containing the sequence of elements in this list.- Returns:
- an integer array containing the sequence of elements in this list
-
toString
public java.lang.String toString()
Returns a string representation of this list that is obtained by callingjava.util.Arrays.toString(this.toArray()).- Overrides:
toStringin classjava.lang.Object- Returns:
- a string representation of this list
-
-