org.joe_e.array
Class DoubleArray.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<Double>
              extended by org.joe_e.array.DoubleArray.Builder
All Implemented Interfaces:
ArrayBuilder<Double>
Enclosing class:
DoubleArray

public static final class DoubleArray.Builder
extends PowerlessArray.Builder<Double>

A DoubleArray factory.


Method Summary
 void append(double newDouble)
          Append a double
 void append(Double newDouble)
          Append a Double
 void append(double[] newDoubles)
          Append an array of doubles
 void append(Double[] newDoubles)
          Append an array of Doubles
 void append(double[] newDoubles, int off, int len)
          Append a range of elements from an array of doubles
 void append(Double[] newDoubles, int off, int len)
          Append a range of elements from an array of Doubles
 DoubleArray 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(Double newDouble)
Append a Double

Specified by:
append in interface ArrayBuilder<Double>
Overrides:
append in class PowerlessArray.Builder<Double>
Parameters:
newDouble - 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(Double[] newDoubles)
Append an array of Doubles

Specified by:
append in interface ArrayBuilder<Double>
Overrides:
append in class PowerlessArray.Builder<Double>
Parameters:
newDoubles - 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(Double[] newDoubles,
                   int off,
                   int len)
Append a range of elements from an array of Doubles

Specified by:
append in interface ArrayBuilder<Double>
Overrides:
append in class PowerlessArray.Builder<Double>
Parameters:
newDoubles - 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 DoubleArray snapshot()
Create a snapshot of the current content.

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

append

public void append(double newDouble)
Append a double

Parameters:
newDouble - 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(double[] newDoubles)
Append an array of doubles

Parameters:
newDoubles - 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(double[] newDoubles,
                   int off,
                   int len)
Append a range of elements from an array of doubles

Parameters:
newDoubles - 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.