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

public static final class BooleanArray.Builder
extends PowerlessArray.Builder<Boolean>

A BooleanArray factory.


Method Summary
 void append(boolean newBoolean)
          Append a boolean
 void append(Boolean newBoolean)
          Append a Boolean
 void append(boolean[] newBooleans)
          Append an array of booleans
 void append(Boolean[] newBooleans)
          Append an array of Booleans
 void append(boolean[] newBooleans, int off, int len)
          Append a range of elements from an array of booleans
 void append(Boolean[] newBooleans, int off, int len)
          Append a range of elements from an array of Booleans
 BooleanArray 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(Boolean newBoolean)
Append a Boolean

Specified by:
append in interface ArrayBuilder<Boolean>
Overrides:
append in class PowerlessArray.Builder<Boolean>
Parameters:
newBoolean - 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(Boolean[] newBooleans)
Append an array of Booleans

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

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

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

append

public void append(boolean newBoolean)
Append a boolean

Parameters:
newBoolean - 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(boolean[] newBooleans)
Append an array of booleans

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

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