Main Page | Modules | Class Hierarchy | Class List | Directories | File List | Class Members | Related Pages

java::lang::StringBuffer Class Reference

A string buffer implements a mutable sequence of characters. More...

#include <java_lang_StringBuffer.h>

Inheritance diagram for java::lang::StringBuffer:

Inheritance graph
[legend]
Collaboration diagram for java::lang::StringBuffer:

Collaboration graph
[legend]
List of all members.

Public Types

enum  {
  xmogDefaultFlags = xmog_base::GLOBAL, xmogMajorVersion = 3, xmogMinorVersion = 2, xmogPatchVersion = 9,
  xmogBuildNumber = 2047
}
typedef ::xmog_java_array_template<
::java::lang::StringBuffer
array1D
typedef ::xmog_java_array_template<
::xmog_java_array_template<
::java::lang::StringBuffer > > 
array2D

Public Member Functions

::java::lang::StringBuffer _delete (jint start, jint end,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Removes the characters in a substring of this StringBuffer.
::java::lang::StringBuffer append (const ::xmog_java_char_array &str, jint offset, jint len,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Appends the string representation of a subarray of the char array argument to this string buffer.
::java::lang::StringBuffer append (const ::xmog_java_char_array &str,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Appends the string representation of the char array argument to this string buffer.
::java::lang::StringBuffer append (const ::java::lang::StringBuffer &sb,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Appends the specified StringBuffer to this StringBuffer.
::java::lang::StringBuffer append (const ::java::lang::String &str,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Appends the string to this string buffer.
::java::lang::StringBuffer append (const ::java::lang::Object &obj,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Appends the string representation of the Object argument to this string buffer.
::java::lang::StringBuffer append (jdouble d,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Appends the string representation of the double argument to this string buffer.
::java::lang::StringBuffer append (jfloat f,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Appends the string representation of the float argument to this string buffer.
::java::lang::StringBuffer append (jchar c,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Appends the string representation of the char argument to this string buffer.
::java::lang::StringBuffer append (jlong l,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Appends the string representation of the long argument to this string buffer.
::java::lang::StringBuffer append (jint i,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Appends the string representation of the int argument to this string buffer.
::java::lang::StringBuffer append (bool b,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Appends the string representation of the boolean argument to the string buffer.
jint capacity (::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Returns the current capacity of the String buffer.
jchar charAt (jint index,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 The specified character of the sequence currently represented by the string buffer, as indicated by the index argument, is returned.
::java::lang::StringBuffer deleteCharAt (jint index,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Removes the character at the specified position in this StringBuffer (shortening the StringBuffer by one character).
void ensureCapacity (jint minimumCapacity,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Ensures that the capacity of the buffer is at least equal to the specified minimum.
void getChars (jint srcBegin, jint srcEnd, const ::xmog_java_char_array &dst, jint dstBegin,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Characters are copied from this string buffer into the destination character array dst.
jint indexOf (const ::java::lang::String &str, jint fromIndex,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Returns the index within this string of the first occurrence of the specified substring, starting at the specified index.
jint indexOf (const ::java::lang::String &str,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Returns the index within this string of the first occurrence of the specified substring.
::java::lang::StringBuffer insert (jint index, const ::xmog_java_char_array &str, jint offset, jint len,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Inserts the string representation of a subarray of the str array argument into this string buffer.
::java::lang::StringBuffer insert (jint offset, const ::xmog_java_char_array &str,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Inserts the string representation of the char array argument into this string buffer.
::java::lang::StringBuffer insert (jint offset, const ::java::lang::String &str,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Inserts the string into this string buffer.
::java::lang::StringBuffer insert (jint offset, const ::java::lang::Object &obj,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Inserts the string representation of the Object argument into this string buffer.
::java::lang::StringBuffer insert (jint offset, jdouble d,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Inserts the string representation of the double argument into this string buffer.
::java::lang::StringBuffer insert (jint offset, jfloat f,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Inserts the string representation of the float argument into this string buffer.
::java::lang::StringBuffer insert (jint offset, jlong l,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Inserts the string representation of the long argument into this string buffer.
::java::lang::StringBuffer insert (jint offset, jchar c,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Inserts the string representation of the char argument into this string buffer.
::java::lang::StringBuffer insert (jint offset, bool b,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Inserts the string representation of the boolean argument into this string buffer.
::java::lang::StringBuffer insert (jint offset, jint i,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Inserts the string representation of the second int argument into this string buffer.
jint lastIndexOf (const ::java::lang::String &str, jint fromIndex,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Returns the index within this string of the last occurrence of the specified substring.
jint lastIndexOf (const ::java::lang::String &str,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Returns the index within this string of the rightmost occurrence of the specified substring.
jint length (::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Returns the length (character count) of this string buffer.
::java::lang::StringBuffer replace (jint start, jint end, const ::java::lang::String &str,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Replaces the characters in a substring of this StringBuffer with characters in the specified String.
::java::lang::StringBuffer reverse (::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 The character sequence contained in this string buffer is replaced by the reverse of the sequence.
void setCharAt (jint index, jchar ch,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 The character at the specified index of this string buffer is set to ch.
void setLength (jint newLength,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Sets the length of this String buffer.
 StringBuffer (::xmog_dummy _use_java_ctor,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Constructs a string buffer with no characters in it and an initial capacity of 16 characters.
 StringBuffer (const ::java::lang::String &str,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Constructs a string buffer so that it represents the same sequence of characters as the string argument; in other words, the initial contents of the string buffer is a copy of the argument string.
 StringBuffer (jint length,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Constructs a string buffer with no characters in it and an initial capacity specified by the length argument.

Detailed Description

A string buffer implements a mutable sequence of characters.

A string buffer is like a , but can be modified. At any point in time it contains some particular sequence of characters, but the length and content of the sequence can be changed through certain method calls.

String buffers are safe for use by multiple threads. The methods are synchronized where necessary so that all the operations on any particular instance behave as if they occur in some serial order that is consistent with the order of the method calls made by each of the individual threads involved.

String buffers are used by the compiler to implement the binary string concatenation operator +. For example, the code:

<blockquote>

                 x = "a" + 4 + "c"

</blockquote>

is compiled to the equivalent of:

<blockquote>

                 x = new StringBuffer().append("a").append(4).append("c")
                                       .toString()

</blockquote> which creates a new string buffer (initially empty), appends the string representation of each operand to the string buffer in turn, and then converts the contents of the string buffer to a string. Overall, this avoids creating many temporary strings.

The principal operations on a StringBuffer are the append and insert methods, which are overloaded so as to accept data of any type. Each effectively converts a given datum to a string and then appends or inserts the characters of that string to the string buffer. The append method always adds these characters at the end of the buffer; the insert method adds the characters at a specified point.

For example, if z refers to a string buffer object whose current contents are "<code>start</code>", then the method call z.append("le") would cause the string buffer to contain "<code>startle</code>", whereas z.insert(4, "le") would alter the string buffer to contain "<code>starlet</code>".

In general, if sb refers to an instance of a StringBuffer, then sb.append(x) has the same effect as sb.insert(sb.length(), x).

Every string buffer has a capacity. As long as the length of the character sequence contained in the string buffer does not exceed the capacity, it is not necessary to allocate a new internal buffer array. If the internal buffer overflows, it is automatically made larger.

Author:
Arthur van Hoff


Constructor & Destructor Documentation

java::lang::StringBuffer::StringBuffer jint  length,
::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
 

Constructs a string buffer with no characters in it and an initial capacity specified by the length argument.

Parameters:
length the initial capacity.
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.

java::lang::StringBuffer::StringBuffer const ::java::lang::String str,
::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
 

Constructs a string buffer so that it represents the same sequence of characters as the string argument; in other words, the initial contents of the string buffer is a copy of the argument string.

The initial capacity of the string buffer is 16 plus the length of the string argument.

Parameters:
str the initial contents of the buffer.
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.

java::lang::StringBuffer::StringBuffer ::xmog_dummy  _use_java_ctor,
::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
 

Constructs a string buffer with no characters in it and an initial capacity of 16 characters.

Parameters:
_use_java_ctor indicates that you want to delegate to a Java constructor whose natural proxy conflicts with a C++ requirement.
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.


Member Function Documentation

::java::lang::StringBuffer java::lang::StringBuffer::_delete jint  start,
jint  end,
::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
 

Removes the characters in a substring of this StringBuffer.

The substring begins at the specified start and extends to the character at index end - 1 or to the end of the StringBuffer if no such character exists. If start is equal to end, no changes are made.

Parameters:
start The beginning index, inclusive.
end The ending index, exclusive.
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:
This string buffer.

::java::lang::StringBuffer java::lang::StringBuffer::append const ::xmog_java_char_array str,
jint  offset,
jint  len,
::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
 

Appends the string representation of a subarray of the char array argument to this string buffer.

Characters of the character array str, starting at index offset, are appended, in order, to the contents of this string buffer. The length of this string buffer increases by the value of len.

The overall effect is exactly as if the arguments were converted to a string by the method and the characters of that string were then appended to this StringBuffer object.

Parameters:
str the characters to be appended.
offset the index of the first character to append.
len the number of characters to append.
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:
a reference to this StringBuffer object.

::java::lang::StringBuffer java::lang::StringBuffer::append const ::xmog_java_char_array str,
::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
 

Appends the string representation of the char array argument to this string buffer.

The characters of the array argument are appended, in order, to the contents of this string buffer. The length of this string buffer increases by the length of the argument.

The overall effect is exactly as if the argument were converted to a string by the method and the characters of that string were then appended to this StringBuffer object.

Parameters:
str the characters to be appended.
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:
a reference to this StringBuffer object.

::java::lang::StringBuffer java::lang::StringBuffer::append const ::java::lang::StringBuffer sb,
::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
 

Appends the specified StringBuffer to this StringBuffer.

The characters of the StringBuffer argument are appended, in order, to the contents of this StringBuffer, increasing the length of this StringBuffer by the length of the argument. If sb is null, then the four characters "null" are appended to this StringBuffer.

Let n be the length of the old character sequence, the one contained in the StringBuffer just prior to execution of the append method. Then the character at index k in the new character sequence is equal to the character at index k in the old character sequence, if k is less than n; otherwise, it is equal to the character at index k-n in the argument sb.

The method ensureCapacity is first called on this StringBuffer with the new buffer length as its argument. (This ensures that the storage of this StringBuffer is adequate to contain the additional characters being appended.)

Parameters:
sb the StringBuffer to append.
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:
a reference to this StringBuffer.

::java::lang::StringBuffer java::lang::StringBuffer::append const ::java::lang::String str,
::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
 

Appends the string to this string buffer.

The characters of the String argument are appended, in order, to the contents of this string buffer, increasing the length of this string buffer by the length of the argument. If str is null, then the four characters "null" are appended to this string buffer.

Let n be the length of the old character sequence, the one contained in the string buffer just prior to execution of the append method. Then the character at index k in the new character sequence is equal to the character at index k in the old character sequence, if k is less than n; otherwise, it is equal to the character at index k-n in the argument str.

Parameters:
str a string.
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:
a reference to this StringBuffer.

::java::lang::StringBuffer java::lang::StringBuffer::append const ::java::lang::Object obj,
::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
 

Appends the string representation of the Object argument to this string buffer.

The argument is converted to a string as if by the method String.valueOf, and the characters of that string are then appended to this string buffer.

Parameters:
obj an Object.
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:
a reference to this StringBuffer object.

::java::lang::StringBuffer java::lang::StringBuffer::append jdouble  d,
::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
 

Appends the string representation of the double argument to this string buffer.

The argument is converted to a string as if by the method String.valueOf, and the characters of that string are then appended to this string buffer.

Parameters:
d a double.
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:
a reference to this StringBuffer object.

::java::lang::StringBuffer java::lang::StringBuffer::append jfloat  f,
::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
 

Appends the string representation of the float argument to this string buffer.

The argument is converted to a string as if by the method String.valueOf, and the characters of that string are then appended to this string buffer.

Parameters:
f a float.
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:
a reference to this StringBuffer object.

::java::lang::StringBuffer java::lang::StringBuffer::append jchar  c,
::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
 

Appends the string representation of the char argument to this string buffer.

The argument is appended to the contents of this string buffer. The length of this string buffer increases by 1.

The overall effect is exactly as if the argument were converted to a string by the method and the character in that string were then appended to this StringBuffer object.

Parameters:
c a char.
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:
a reference to this StringBuffer object.

::java::lang::StringBuffer java::lang::StringBuffer::append jlong  l,
::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
 

Appends the string representation of the long argument to this string buffer.

The argument is converted to a string as if by the method String.valueOf, and the characters of that string are then appended to this string buffer.

Parameters:
l a long.
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:
a reference to this StringBuffer object.

::java::lang::StringBuffer java::lang::StringBuffer::append jint  i,
::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
 

Appends the string representation of the int argument to this string buffer.

The argument is converted to a string as if by the method String.valueOf, and the characters of that string are then appended to this string buffer.

Parameters:
i an int.
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:
a reference to this StringBuffer object.

::java::lang::StringBuffer java::lang::StringBuffer::append bool  b,
::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
 

Appends the string representation of the boolean argument to the string buffer.

The argument is converted to a string as if by the method String.valueOf, and the characters of that string are then appended to this string buffer.

Parameters:
b a boolean.
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:
a reference to this StringBuffer.

jint java::lang::StringBuffer::capacity ::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
 

Returns the current capacity of the String buffer.

The capacity is the amount of storage available for newly inserted characters; beyond which an allocation will occur.

Parameters:
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:
the current capacity of this string buffer.

jchar java::lang::StringBuffer::charAt jint  index,
::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
[virtual]
 

The specified character of the sequence currently represented by the string buffer, as indicated by the index argument, is returned.

The first character of a string buffer is at index 0, the next at index 1, and so on, for array indexing.

The index argument must be greater than or equal to 0, and less than the length of this string buffer.

Parameters:
index the index of the desired character.
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:
the character at the specified index of this string buffer.

Reimplemented from java::lang::CharSequence.

::java::lang::StringBuffer java::lang::StringBuffer::deleteCharAt jint  index,
::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
 

Removes the character at the specified position in this StringBuffer (shortening the StringBuffer by one character).

Parameters:
index Index of character to remove
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:
This string buffer.

void java::lang::StringBuffer::ensureCapacity jint  minimumCapacity,
::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
 

Ensures that the capacity of the buffer is at least equal to the specified minimum.

If the current capacity of this string buffer is less than the argument, then a new internal buffer is allocated with greater capacity. The new capacity is the larger of:

  • The minimumCapacity argument.
  • Twice the old capacity, plus 2.
If the minimumCapacity argument is nonpositive, this method takes no action and simply returns.

Parameters:
minimumCapacity the minimum desired capacity.
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:

void java::lang::StringBuffer::getChars jint  srcBegin,
jint  srcEnd,
const ::xmog_java_char_array dst,
jint  dstBegin,
::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
 

Characters are copied from this string buffer into the destination character array dst.

The first character to be copied is at index srcBegin; the last character to be copied is at index srcEnd-1. The total number of characters to be copied is srcEnd-srcBegin. The characters are copied into the subarray of dst starting at index dstBegin and ending at index:

<blockquote>

                 dstbegin + (srcEnd-srcBegin) - 1

</blockquote>

Parameters:
srcBegin start copying at this offset in the string buffer.
srcEnd stop copying at this offset in the string buffer.
dst the array to copy the data into.
dstBegin offset into dst.
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:

jint java::lang::StringBuffer::indexOf const ::java::lang::String str,
jint  fromIndex,
::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
 

Returns the index within this string of the first occurrence of the specified substring, starting at the specified index.

The integer returned is the smallest value k for which: <blockquote>

                     k >= Math.min(fromIndex, str.length()) &&
                                   this.toString().startsWith(str, k)

</blockquote> If no such value of k exists, then -1 is returned.

Parameters:
str the substring for which to search.
fromIndex the index from which to start the search.
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:
the index within this string of the first occurrence of the specified substring, starting at the specified index.

jint java::lang::StringBuffer::indexOf const ::java::lang::String str,
::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
 

Returns the index within this string of the first occurrence of the specified substring.

The integer returned is the smallest value k such that: <blockquote>

                 this.toString().startsWith(str, <i>k</i>)

</blockquote> is true.

Parameters:
str any string.
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:
if the string argument occurs as a substring within this object, then the index of the first character of the first such substring is returned; if it does not occur as a substring, -1 is returned.

::java::lang::StringBuffer java::lang::StringBuffer::insert jint  index,
const ::xmog_java_char_array str,
jint  offset,
jint  len,
::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
 

Inserts the string representation of a subarray of the str array argument into this string buffer.

The subarray begins at the specified offset and extends len characters. The characters of the subarray are inserted into this string buffer at the position indicated by index. The length of this StringBuffer increases by len characters.

Parameters:
index position at which to insert subarray.
str A character array.
offset the index of the first character in subarray to to be inserted.
len the number of characters in the subarray to to be inserted.
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:
This string buffer.

::java::lang::StringBuffer java::lang::StringBuffer::insert jint  offset,
const ::xmog_java_char_array str,
::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
 

Inserts the string representation of the char array argument into this string buffer.

The characters of the array argument are inserted into the contents of this string buffer at the position indicated by offset. The length of this string buffer increases by the length of the argument.

The overall effect is exactly as if the argument were converted to a string by the method and the characters of that string were then inserted into this StringBuffer object at the position indicated by offset.

Parameters:
offset the offset.
str a character array.
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:
a reference to this StringBuffer object.

::java::lang::StringBuffer java::lang::StringBuffer::insert jint  offset,
const ::java::lang::String str,
::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
 

Inserts the string into this string buffer.

The characters of the String argument are inserted, in order, into this string buffer at the indicated offset, moving up any characters originally above that position and increasing the length of this string buffer by the length of the argument. If str is null, then the four characters "null" are inserted into this string buffer.

The character at index k in the new character sequence is equal to:

  • the character at index k in the old character sequence, if k is less than offset
  • the character at index k-offset in the argument str, if k is not less than offset but is less than offset+str.length()
  • the character at index k-str.length() in the old character sequence, if k is not less than offset+str.length()

The offset argument must be greater than or equal to 0, and less than or equal to the length of this string buffer.

Parameters:
offset the offset.
str a string.
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:
a reference to this StringBuffer object.

::java::lang::StringBuffer java::lang::StringBuffer::insert jint  offset,
const ::java::lang::Object obj,
::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
 

Inserts the string representation of the Object argument into this string buffer.

The second argument is converted to a string as if by the method String.valueOf, and the characters of that string are then inserted into this string buffer at the indicated offset.

The offset argument must be greater than or equal to 0, and less than or equal to the length of this string buffer.

Parameters:
offset the offset.
obj an Object.
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:
a reference to this StringBuffer object.

::java::lang::StringBuffer java::lang::StringBuffer::insert jint  offset,
jdouble  d,
::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
 

Inserts the string representation of the double argument into this string buffer.

The second argument is converted to a string as if by the method String.valueOf, and the characters of that string are then inserted into this string buffer at the indicated offset.

The offset argument must be greater than or equal to 0, and less than or equal to the length of this string buffer.

Parameters:
offset the offset.
d a double.
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:
a reference to this StringBuffer object.

::java::lang::StringBuffer java::lang::StringBuffer::insert jint  offset,
jfloat  f,
::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
 

Inserts the string representation of the float argument into this string buffer.

The second argument is converted to a string as if by the method String.valueOf, and the characters of that string are then inserted into this string buffer at the indicated offset.

The offset argument must be greater than or equal to 0, and less than or equal to the length of this string buffer.

Parameters:
offset the offset.
f a float.
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:
a reference to this StringBuffer object.

::java::lang::StringBuffer java::lang::StringBuffer::insert jint  offset,
jlong  l,
::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
 

Inserts the string representation of the long argument into this string buffer.

The second argument is converted to a string as if by the method String.valueOf, and the characters of that string are then inserted into this string buffer at the position indicated by offset.

The offset argument must be greater than or equal to 0, and less than or equal to the length of this string buffer.

Parameters:
offset the offset.
l a long.
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:
a reference to this StringBuffer object.

::java::lang::StringBuffer java::lang::StringBuffer::insert jint  offset,
jchar  c,
::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
 

Inserts the string representation of the char argument into this string buffer.

The second argument is inserted into the contents of this string buffer at the position indicated by offset. The length of this string buffer increases by one.

The overall effect is exactly as if the argument were converted to a string by the method and the character in that string were then inserted into this StringBuffer object at the position indicated by offset.

The offset argument must be greater than or equal to 0, and less than or equal to the length of this string buffer.

Parameters:
offset the offset.
c a char.
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:
a reference to this StringBuffer object.

::java::lang::StringBuffer java::lang::StringBuffer::insert jint  offset,
bool  b,
::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
 

Inserts the string representation of the boolean argument into this string buffer.

The second argument is converted to a string as if by the method String.valueOf, and the characters of that string are then inserted into this string buffer at the indicated offset.

The offset argument must be greater than or equal to 0, and less than or equal to the length of this string buffer.

Parameters:
offset the offset.
b a boolean.
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:
a reference to this StringBuffer object.

::java::lang::StringBuffer java::lang::StringBuffer::insert jint  offset,
jint  i,
::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
 

Inserts the string representation of the second int argument into this string buffer.

The second argument is converted to a string as if by the method String.valueOf, and the characters of that string are then inserted into this string buffer at the indicated offset.

The offset argument must be greater than or equal to 0, and less than or equal to the length of this string buffer.

Parameters:
offset the offset.
i an int.
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:
a reference to this StringBuffer object.

jint java::lang::StringBuffer::lastIndexOf const ::java::lang::String str,
jint  fromIndex,
::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
 

Returns the index within this string of the last occurrence of the specified substring.

The integer returned is the largest value k such that: <blockquote>

                     k <= Math.min(fromIndex, str.length()) &&
                                   this.toString().startsWith(str, k)

</blockquote> If no such value of k exists, then -1 is returned.

Parameters:
str the substring to search for.
fromIndex the index to start the search from.
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:
the index within this string of the last occurrence of the specified substring.

jint java::lang::StringBuffer::lastIndexOf const ::java::lang::String str,
::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags