NASA World Wind

gov.nasa.worldwind.util
Class CompoundStringBuffer

java.lang.Object
  extended by gov.nasa.worldwind.util.CompoundBuffer<java.lang.StringBuilder,java.lang.CharSequence>
      extended by gov.nasa.worldwind.util.CompoundStringBuffer

public class CompoundStringBuffer
extends CompoundBuffer<java.lang.StringBuilder,java.lang.CharSequence>

An implementation of CompoundBuffer which manages a collection of CharSequence buffers in a single StringBuilder.


Field Summary
 
Fields inherited from class gov.nasa.worldwind.util.CompoundBuffer
buffer, DEFAULT_INITIAL_CAPACITY, numSubBuffers, size, subLengthBuffer, subPositionBuffer
 
Constructor Summary
CompoundStringBuffer(int initialCapacity, int subSequenceLength)
          Constructs a CompoundStringBuffer with the specified initial capacity.
 
Method Summary
protected  void append(java.lang.CharSequence buffer)
           
protected  int getSize(java.lang.CharSequence buffer)
           
protected  java.lang.CharSequence getSubBuffer(int position, int length)
           
 java.lang.String getSubString(int index)
          Returns the substring identified by the specified index.
 
Methods inherited from class gov.nasa.worldwind.util.CompoundBuffer
appendEmptyBuffer, appendSubBuffer, clear, computeNewSize, getBackingBuffer, getNumSubBuffers, getSubBuffer, getSubLengthBuffer, getSubPositionBuffer, getTotalBufferSize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CompoundStringBuffer

public CompoundStringBuffer(int initialCapacity,
                            int subSequenceLength)
Constructs a CompoundStringBuffer with the specified initial capacity.

Parameters:
initialCapacity - the compound buffer's initial capacity.
subSequenceLength - an estimate of the size of each sub-sequence.
Throws:
java.lang.IllegalArgumentException - if the initialCapacity is negative.
Method Detail

append

protected void append(java.lang.CharSequence buffer)
Specified by:
append in class CompoundBuffer<java.lang.StringBuilder,java.lang.CharSequence>

getSize

protected int getSize(java.lang.CharSequence buffer)
Specified by:
getSize in class CompoundBuffer<java.lang.StringBuilder,java.lang.CharSequence>

getSubBuffer

protected java.lang.CharSequence getSubBuffer(int position,
                                              int length)
Specified by:
getSubBuffer in class CompoundBuffer<java.lang.StringBuilder,java.lang.CharSequence>

getSubString

public java.lang.String getSubString(int index)
Returns the substring identified by the specified index. Index i corresponds to the ith string.

Parameters:
index - the index of the string to get.
Returns:
the string at the specified index.
Throws:
java.lang.IllegalArgumentException - if the index is out of range.

NASA World Wind