org.joe_e.array
Class FloatArray.Builder

java.lang.Object
  extended by org.joe_e.array.ConstArray.Builder<E>
      extended by org.joe_e.array.ImmutableArray.Builder<E>
          extended by org.joe_e.array.PowerlessArray.Builder<Float>
              extended by org.joe_e.array.FloatArray.Builder
All Implemented Interfaces:
ArrayBuilder<Float>
Enclosing class:
FloatArray

public static final class FloatArray.Builder
extends PowerlessArray.Builder<Float>

A FloatArray factory.


Method Summary
 void append(float newFloat)
          Append a float
 void append(Float newFloat)
          Append a Float
 void append(float[] newFloats)
          Append an array of floats
 void append(Float[] newFloats)
          Append an array of Floats
 void append(float[] newFloats, int off, int len)
          Append a range of elements from an array of floats
 void append(Float[] newFloats, int off, int len)
          Append a range of elements from an array of Floats
 FloatArray snapshot()
          Create a snapshot of the current content.
 
Methods inherited from class org.joe_e.array.ConstArray.Builder
length
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

append

public void append(Float newFloat)
Append a Float

Specified by:
append in interface ArrayBuilder<Float>
Overrides:
append in class PowerlessArray.Builder<Float>
Parameters:
newFloat - the element to add
Throws:
NegativeArraySizeException - if the resulting internal array would exceed the maximum length of a Java array. The builder is unmodified.

append

public void append(Float[] newFloats)
Append an array of Floats

Specified by:
append in interface ArrayBuilder<Float>
Overrides:
append in class PowerlessArray.Builder<Float>
Parameters:
newFloats - the elements to add
Throws:
IndexOutOfBoundsException - if the resulting internal array would exceed the maximum length of a Java array. The builder is unmodified.

append

public void append(Float[] newFloats,
                   int off,
                   int len)
Append a range of elements from an array of Floats

Specified by:
append in interface ArrayBuilder<Float>
Overrides:
append in class PowerlessArray.Builder<Float>
Parameters:
newFloats - the array to add elements from
off - the index of the first element to add
len - the number of elements to add
Throws:
IndexOutOfBoundsException - if an out-of-bounds index would be referenced or the resulting internal array would exceed the maximum length of a Java array. The builder is unmodified.

snapshot

public FloatArray snapshot()
Create a snapshot of the current content.

Specified by:
snapshot in interface ArrayBuilder<Float>
Overrides:
snapshot in class PowerlessArray.Builder<Float>
Returns:
a FloatArray containing the elements so far

append

public void append(float newFloat)
Append a float

Parameters:
newFloat - the element to add
Throws:
NegativeArraySizeException - if the resulting internal array would exceed the maximum length of a Java array. The builder is unmodified.

append

public void append(float[] newFloats)
Append an array of floats

Parameters:
newFloats - the elements to add
Throws:
IndexOutOfBoundsException - if the resulting internal array would exceed the maximum length of a Java array. The builder is unmodified.

append

public void append(float[] newFloats,
                   int off,
                   int len)
Append a range of elements from an array of floats

Parameters:
newFloats - the array to add elements from
off - the index of the first element to add
len - the number of elements to add
Throws:
IndexOutOfBoundsException - if an out-of-bounds index would be referenced or the resulting internal array would exceed the maximum length of a Java array. The builder is unmodified.