Service Activator Toolkit
Version 1.1.0 (20081206)

org.eclipse.soda.sat.core.framework.interfaces
Interface ICharBuffer


public interface ICharBuffer

The ICharBuffer interface defines the API of an unsynchronized character buffer.


Field Summary
static short GROW_EXPONENTIALLY
          This grow style cause the buffer to grow exponentially in multiples of the buffer's current capacity.
static short GROW_LINEARLY
          This grow style causes the buffer to grow linearly in multiples of the buffer's initial capacity.
 
Method Summary
 ICharBuffer append(boolean booleanValue)
          Append a boolean to the buffer.
 ICharBuffer append(char charValue)
          Append a single character to the buffer.
 ICharBuffer append(char[] array)
          Append characters from an array to the buffer.
 ICharBuffer append(char[] array, int start, int length)
          Append characters from an array to the buffer.
 ICharBuffer append(double doubleValue)
          Append a double to the buffer.
 ICharBuffer append(float floatValue)
          Append a float to the buffer.
 ICharBuffer append(int intValue)
          Append an int to the buffer.
 ICharBuffer append(long longValue)
          Append a long to the buffer.
 ICharBuffer append(Object object)
          Append an Object to the buffer.
 ICharBuffer append(String value)
          Append a String to the buffer.
 int capacity()
          Answers the number of characters that can be appended to the buffer without it growing.
 char charAt(int i)
          Answers the character in the buffer at the specified index
 int getGrowPercentage()
          Get the grow percentage used to calculate how much the buffer will grow when its capacity is exhausted.
 short getGrowStyle()
          Get the grow style used to calculate how much the buffer will grow when its capacity is exhausted.
 String getValue()
          Get a String composed of the contents of the buffer.
 int length()
          The number of characters in the buffer.
 void setChar(int i, char ch)
          Set the character at the specified index.
 void setGrowPercentage(int growthFactor)
          Set the grow percentage used to calculate how much the buffer will grow when its capacity is exhausted.
 void setGrowStyle(short growStyle)
          Set the grow style used to calculate how much the buffer will grow when its capacity is exhausted.
 void setLength(int length)
          Set the length of the buffer.
 char[] toArray()
          Answers a new char array containing the contents of the buffer.
 char[] toArray(char[] target)
          Copies the contents of the buffer into the specified char array.
 ICharBuffer toSynchronizedCharBuffer()
          Answers a thread-safe version of the buffer.
 

Field Detail

GROW_LINEARLY

static final short GROW_LINEARLY
This grow style causes the buffer to grow linearly in multiples of the buffer's initial capacity.

See Also:
Constant Field Values

GROW_EXPONENTIALLY

static final short GROW_EXPONENTIALLY
This grow style cause the buffer to grow exponentially in multiples of the buffer's current capacity.

See Also:
Constant Field Values
Method Detail

append

ICharBuffer append(boolean booleanValue)
Append a boolean to the buffer. The value is converted to a String which is appended to the buffer.

Parameters:
booleanValue - The boolean to append to the buffer.
Returns:
The buffer, never null.

append

ICharBuffer append(char charValue)
Append a single character to the buffer.

Parameters:
charValue - The character to append.
Returns:
The buffer, never null.

append

ICharBuffer append(char[] array)
Append characters from an array to the buffer.

Parameters:
array - The source.
Returns:
The buffer, never null.

append

ICharBuffer append(char[] array,
                   int start,
                   int length)
Append characters from an array to the buffer.

Parameters:
array - The source.
start - The index of the first character.
length - The number of characters to append.
Returns:
The buffer, never null.

append

ICharBuffer append(double doubleValue)
Append a double to the buffer. The value is converted to a String which is appended to the buffer.

Parameters:
doubleValue - The double to append to the buffer.
Returns:
The buffer, never null.

append

ICharBuffer append(float floatValue)
Append a float to the buffer. The value is converted to a String which is appended to the buffer.

Parameters:
floatValue - The float to append to the buffer.
Returns:
The buffer, never null.

append

ICharBuffer append(int intValue)
Append an int to the buffer. The value is converted to a String which is appended to the buffer.

Parameters:
intValue - The int to append to the buffer.
Returns:
The buffer, never null.

append

ICharBuffer append(long longValue)
Append a long to the buffer. The value is converted to a String which is appended to the buffer.

Parameters:
longValue - The double to append to the buffer.
Returns:
The buffer, never null.

append

ICharBuffer append(Object object)
Append an Object to the buffer. The object is converted to a String by calling toString(), the result of which is appended to the buffer.

Parameters:
object - The Object to append to the buffer.
Returns:
The buffer, never null.

append

ICharBuffer append(String value)
Append a String to the buffer.

Parameters:
value - The String to append to the buffer.
Returns:
The buffer, never null.

capacity

int capacity()
Answers the number of characters that can be appended to the buffer without it growing.

Returns:
The capacity of the buffer.

charAt

char charAt(int i)
Answers the character in the buffer at the specified index

Parameters:
i - The index.
Returns:
The character at the specified index.

getGrowPercentage

int getGrowPercentage()
Get the grow percentage used to calculate how much the buffer will grow when its capacity is exhausted.

Returns:
A positive integer.

getGrowStyle

short getGrowStyle()
Get the grow style used to calculate how much the buffer will grow when its capacity is exhausted. Valid values:

Returns:
The buffer's grow style.

getValue

String getValue()
Get a String composed of the contents of the buffer.

Returns:
The contents of the buffer.

length

int length()
The number of characters in the buffer.

Returns:
The length of the buffer.

setChar

void setChar(int i,
             char ch)
Set the character at the specified index.

Parameters:
i - The index.
ch - The character.

setGrowPercentage

void setGrowPercentage(int growthFactor)
Set the grow percentage used to calculate how much the buffer will grow when its capacity is exhausted.

Parameters:
growthFactor - A positive integer.

setGrowStyle

void setGrowStyle(short growStyle)
Set the grow style used to calculate how much the buffer will grow when its capacity is exhausted. Valid values:

Parameters:
growStyle - A grow style.

setLength

void setLength(int length)
Set the length of the buffer. If the buffer's length is greater than the specified length, the characters beyond the specified length are deleted. If the buffer's length is less than the specified length, additional character are set to (char) 0.

Parameters:
length - The new length of the buffer, which may not exceed the buffer's capacity.

toArray

char[] toArray()
Answers a new char array containing the contents of the buffer.

Returns:
A char array containing the contents of the buffer.

toArray

char[] toArray(char[] target)
Copies the contents of the buffer into the specified char array. If the array is not big enough and new array is created.

Parameters:
target - The target array into which the contents of the buffer is copied.
Returns:
A char array containing the contents of the buffer.

toSynchronizedCharBuffer

ICharBuffer toSynchronizedCharBuffer()
Answers a thread-safe version of the buffer.

Returns:
A buffer.

Service Activator Toolkit
Version 1.1.0 (20081206)