ref_send API 2.17
defensive programming in Java

org.joe_e.array
Class CharArray.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<java.lang.Character>
              extended by org.joe_e.array.CharArray.Builder
All Implemented Interfaces:
ArrayBuilder<java.lang.Character>
Enclosing class:
CharArray

public static final class CharArray.Builder
extends PowerlessArray.Builder<java.lang.Character>

A CharArray factory.


Method Summary
 void append(char newChar)
          Append a char
 void append(char[] newChars)
          Append an array of chars
 void append(char[] newChars, int off, int len)
          Append a range of elements from an array of chars
 void append(java.lang.Character newChar)
          Append a Character
 void append(java.lang.Character[] newChars)
          Append an array of Characters
 void append(java.lang.Character[] newChars, int off, int len)
          Append a range of elements from an array of Characters
 CharArray 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
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

append

public void append(java.lang.Character newChar)
Append a Character

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

append

public void append(java.lang.Character[] newChars)
Append an array of Characters

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

append

public void append(java.lang.Character[] newChars,
                   int off,
                   int len)
Append a range of elements from an array of Characters

Specified by:
append in interface ArrayBuilder<java.lang.Character>
Overrides:
append in class PowerlessArray.Builder<java.lang.Character>
Parameters:
newChars - the array to add elements from
off - the index of the first element to add
len - the number of elements to add
Throws:
java.lang.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 CharArray snapshot()
Create a snapshot of the current content.

Specified by:
snapshot in interface ArrayBuilder<java.lang.Character>
Overrides:
snapshot in class PowerlessArray.Builder<java.lang.Character>
Returns:
a CharArray containing the elements so far

append

public void append(char newChar)
Append a char

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

append

public void append(char[] newChars)
Append an array of chars

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

append

public void append(char[] newChars,
                   int off,
                   int len)
Append a range of elements from an array of chars

Parameters:
newChars - the array to add elements from
off - the index of the first element to add
len - the number of elements to add
Throws:
java.lang.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.

ref_send API 2.17
defensive programming in Java

Submit a bug or feature, or get help

Copyright 1998-2009 Waterken Inc. under the terms of the MIT X license.