|
NASA World Wind | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectgov.nasa.worldwind.util.CompoundStringBuilder
public class CompoundStringBuilder
CompoundStringBuilder provides a mechanism for storing and retrieving a collection of variable length strings in a
single StringBuilder.
| Field Summary | |
|---|---|
protected StringBuilder |
buffer
|
protected int |
capacity
|
protected int |
count
|
protected static int |
DEFAULT_INITIAL_CAPACITY
|
protected int[] |
lengths
|
protected int[] |
offsets
|
| Constructor Summary | |
|---|---|
CompoundStringBuilder()
Constructs a CompoundStringBuilder with a default backing StringBuilder, and the default initial capacity. |
|
CompoundStringBuilder(int capacity)
Constructs a CompoundStringBuilder with a default backing StringBuilder, and the specified initial capacity. |
|
CompoundStringBuilder(StringBuilder stringBuilder,
int capacity)
Constructs a CompoundStringBuilder with the specified backing StringBuilder and initial capacity. |
|
| Method Summary | |
|---|---|
int |
append(CharSequence charSequence)
Appends the contents of the specified substring to the end of this CompoundStringBuilder, incrementing the number of substrings by one. |
void |
clear()
Clears this CompoundStringBuilder's backing StringBuilder and sets the number of substrings to zero. |
protected void |
expandCapacity(int minCapacity)
|
int |
size()
Returns the number of strings stored in this CompoundStringBuilder. |
CharSequence |
subSequence(int index)
Returns the substring at the specified index as a CharSequence. |
String |
substring(int index)
Returns the substring at the specified index as a String. |
int |
substringLength(int index)
Returns the length of the substring with the specified index. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected StringBuilder buffer
protected int capacity
protected int count
protected static final int DEFAULT_INITIAL_CAPACITY
protected int[] lengths
protected int[] offsets
| Constructor Detail |
|---|
public CompoundStringBuilder()
public CompoundStringBuilder(int capacity)
capacity - the compound buffer's initial capacity.
IllegalArgumentException - if the capacity is less than 1.
public CompoundStringBuilder(StringBuilder stringBuilder,
int capacity)
stringBuilder - the StringBuilder in which to store the string data.capacity - the compound buffer's initial capacity.
IllegalArgumentException - if the stringBuilder is null or if the capacity is less than 1.| Method Detail |
|---|
public int append(CharSequence charSequence)
charSequence - the substring to append.
IllegalArgumentException - if the charSequence is null.public void clear()
protected void expandCapacity(int minCapacity)
public int size()
public CharSequence subSequence(int index)
CharSequence.
index - the index of the substring to return.
IllegalArgumentException - if the index is out of range.public String substring(int index)
String.
index - the index of the substring to return.
IllegalArgumentException - if the index is out of range.public int substringLength(int index)
index - the index for the substring who's length is returned.
IllegalArgumentException - if the index is out of range.
|
NASA World Wind | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||