StringBuffer StringBuffer Class

Definition

A modifiable ICharSequence for use in creating strings, where all accesses are synchronized.

[Android.Runtime.Register("java/lang/StringBuffer", ApiSince=1, DoNotGenerateAcw=true)]
public sealed class StringBuffer : Java.Lang.AbstractStringBuilder, IDisposable, Java.IO.ISerializable, System.Collections.Generic.IEnumerable<char>
type StringBuffer = class
    inherit AbstractStringBuilder
    interface ISerializable
    interface IJavaObject
    interface IDisposable
    interface IAppendable
    interface ICharSequence
    interface seq<char>
    interface IEnumerable
Inheritance
Attributes
Implements

Remarks

Android platform documentation

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Constructors

StringBuffer() StringBuffer()

Constructs a new StringBuffer using the default capacity which is 16.

StringBuffer(ICharSequence) StringBuffer(ICharSequence)

Constructs a StringBuffer and initializes it with the content from the specified CharSequence.

StringBuffer(Int32) StringBuffer(Int32)

Constructs a new StringBuffer using the specified capacity.

StringBuffer(String) StringBuffer(String)

Constructs a new StringBuffer containing the characters in the specified string.

Properties

Class Class

Returns the unique instance of Class that represents this object's class.

(Inherited from Object)
Handle Handle

The handle to the underlying Android instance.

(Inherited from Object)
IJavaObjectEx.IsProxy IJavaObjectEx.IsProxy Inherited from Object
IJavaObjectEx.KeyHandle IJavaObjectEx.KeyHandle Inherited from Object
IJavaObjectEx.NeedsActivation IJavaObjectEx.NeedsActivation Inherited from Object
IJavaPeerable.JniManagedPeerState IJavaPeerable.JniManagedPeerState Inherited from Object
JniIdentityHashCode JniIdentityHashCode Inherited from Object
JniPeerMembers JniPeerMembers
PeerReference PeerReference Inherited from Object
ThresholdClass ThresholdClass Inherited from AbstractStringBuilder
ThresholdType ThresholdType Inherited from AbstractStringBuilder

Methods

Append(Boolean) Append(Boolean)

Adds the string representation of the specified boolean to the end of this StringBuffer.

Append(Char) Append(Char)

Adds the specified character to the end of this buffer.

Append(Char[]) Append(Char[])

Adds the character array to the end of this buffer.

Append(Char[], Int32, Int32) Append(Char[], Int32, Int32)

Adds the specified sequence of characters to the end of this buffer.

Append(Double) Append(Double)

Adds the string representation of the specified double to the end of this StringBuffer.

Append(ICharSequence) Append(ICharSequence)

Appends the specified CharSequence to this buffer.

Append(ICharSequence, Int32, Int32) Append(ICharSequence, Int32, Int32)

Appends the specified subsequence of the CharSequence to this buffer.

Append(Int32) Append(Int32)

Adds the string representation of the specified integer to the end of this StringBuffer.

Append(Int64) Append(Int64)

Adds the string representation of the specified long to the end of this StringBuffer.

Append(Object) Append(Object)

Adds the string representation of the specified object to the end of this StringBuffer.

Append(Single) Append(Single)

Adds the string representation of the specified float to the end of this StringBuffer.

Append(String) Append(String)

Adds the specified string to the end of this buffer.

Append(String, Int32, Int32) Append(String, Int32, Int32)
Append(StringBuffer) Append(StringBuffer)

Adds the specified StringBuffer to the end of this buffer.

AppendCodePoint(Int32) AppendCodePoint(Int32)

Appends the string representation of the specified Unicode code point to the end of this buffer.

Capacity() Capacity()

Returns the number of characters that can be held without growing.

CharAt(Int32) CharAt(Int32)

Returns the character at index.

Clone() Clone()

Creates and returns a copy of this Object.

(Inherited from Object)
CodePointAt(Int32) CodePointAt(Int32)

Retrieves the Unicode code point value at the index.

CodePointBefore(Int32) CodePointBefore(Int32)

Retrieves the Unicode code point value that precedes the index.

CodePointCount(Int32, Int32) CodePointCount(Int32, Int32)

Calculates the number of Unicode code points between start and end.

Delete(Int32, Int32) Delete(Int32, Int32)

Deletes a range of characters.

DeleteCharAt(Int32) DeleteCharAt(Int32)

Deletes the character at the specified offset.

Dispose() Dispose() Inherited from Object
Dispose(Boolean) Dispose(Boolean) Inherited from Object
EnsureCapacity(Int32) EnsureCapacity(Int32)

Ensures that this object has a minimum capacity available before requiring the internal buffer to be enlarged.

Equals(Object) Equals(Object)

Compares this instance with the specified object and indicates if they are equal.

(Inherited from Object)
GetChars(Int32, Int32, Char[], Int32) GetChars(Int32, Int32, Char[], Int32)

Copies the requested sequence of characters to the char[] passed starting at idx.

GetEnumerator() GetEnumerator()
GetHashCode() GetHashCode()

Returns an integer hash code for this object.

(Inherited from Object)
IndexOf(String) IndexOf(String)

Searches for the first index of the specified character.

IndexOf(String, Int32) IndexOf(String, Int32)

Searches for the index of the specified character.

Insert(Int32, Boolean) Insert(Int32, Boolean)

Inserts the string representation of the specified boolean into this buffer at the specified offset.

Insert(Int32, Char) Insert(Int32, Char)

Inserts the character into this buffer at the specified offset.

Insert(Int32, Char[]) Insert(Int32, Char[])

Inserts the character array into this buffer at the specified offset.

Insert(Int32, Char[], Int32, Int32) Insert(Int32, Char[], Int32, Int32)

Inserts the specified subsequence of characters into this buffer at the specified index.

Insert(Int32, Double) Insert(Int32, Double)

Inserts the string representation of the specified into this buffer double at the specified offset.

Insert(Int32, ICharSequence) Insert(Int32, ICharSequence)

Inserts the specified CharSequence into this buffer at the specified index.

Insert(Int32, ICharSequence, Int32, Int32) Insert(Int32, ICharSequence, Int32, Int32)

Inserts the specified subsequence into this buffer at the specified index.

Insert(Int32, Int32) Insert(Int32, Int32)

Inserts the string representation of the specified integer into this buffer at the specified offset.

Insert(Int32, Int64) Insert(Int32, Int64)

Inserts the string representation of the specified long into this buffer at the specified offset.

Insert(Int32, Object) Insert(Int32, Object)

Inserts the string representation of the specified object into this buffer at the specified offset.

Insert(Int32, Single) Insert(Int32, Single)

Inserts the string representation of the specified float into this buffer at the specified offset.

Insert(Int32, String) Insert(Int32, String)

Inserts the string into this buffer at the specified offset.

Insert(Int32, String, Int32, Int32) Insert(Int32, String, Int32, Int32)
JavaFinalize() JavaFinalize()

Invoked when the garbage collector has detected that this instance is no longer reachable.

(Inherited from Object)
LastIndexOf(String) LastIndexOf(String)

Searches for the last index of the specified character.

LastIndexOf(String, Int32) LastIndexOf(String, Int32)

Searches for the index of the specified character.

Length() Length()

The current length.

Notify() Notify()

Causes a thread which is waiting on this object's monitor (by means of calling one of the wait() methods) to be woken up.

(Inherited from Object)
NotifyAll() NotifyAll()

Causes all threads which are waiting on this object's monitor (by means of calling one of the wait() methods) to be woken up.

(Inherited from Object)
OffsetByCodePoints(Int32, Int32) OffsetByCodePoints(Int32, Int32)

Returns the index that is offset codePointOffset code points from index.

Replace(Int32, Int32, String) Replace(Int32, Int32, String)

Replaces the characters in the specified range with the contents of the specified string.

Reverse() Reverse()

Reverses the order of characters in this buffer.

SetCharAt(Int32, Char) SetCharAt(Int32, Char)

Sets the character at the index.

SetHandle(IntPtr, JniHandleOwnership) SetHandle(IntPtr, JniHandleOwnership)

Sets the Handle property.

(Inherited from Object)
SetLength(Int32) SetLength(Int32)

Sets the current length to a new value.

SubSequence(Int32, Int32) SubSequence(Int32, Int32)
SubSequenceFormatted(Int32, Int32) SubSequenceFormatted(Int32, Int32)

Returns a CharSequence of the subsequence from the start index to the end index.

Substring(Int32) Substring(Int32)

Returns the String value of the subsequence from the start index to the current end.

Substring(Int32, Int32) Substring(Int32, Int32)

Returns the String value of the subsequence from the start index to the end index.

ToArray<T>() ToArray<T>() Inherited from Object
ToString() ToString()

Returns the current String representation.

TrimToSize() TrimToSize()

Trims off any extra capacity beyond the current length.

UnregisterFromRuntime() UnregisterFromRuntime() Inherited from Object
Wait() Wait()

Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object.

(Inherited from Object)
Wait(Int64) Wait(Int64)

Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the specified timeout expires.

(Inherited from Object)
Wait(Int64, Int32) Wait(Int64, Int32)

Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the specified timeout expires.

(Inherited from Object)

Explicit Interface Implementations

IEnumerable.GetEnumerator() IEnumerable.GetEnumerator()
IJavaObjectEx.ToLocalJniHandle() IJavaObjectEx.ToLocalJniHandle() Inherited from Object
IJavaPeerable.Disposed() IJavaPeerable.Disposed() Inherited from Object
IJavaPeerable.DisposeUnlessReferenced() IJavaPeerable.DisposeUnlessReferenced() Inherited from Object
IJavaPeerable.Finalized() IJavaPeerable.Finalized() Inherited from Object
IJavaPeerable.SetJniIdentityHashCode(Int32) IJavaPeerable.SetJniIdentityHashCode(Int32) Inherited from Object
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) Inherited from Object
IJavaPeerable.SetPeerReference(JniObjectReference) IJavaPeerable.SetPeerReference(JniObjectReference) Inherited from Object

Extension Methods

JavaCast<TResult>(IJavaObject) JavaCast<TResult>(IJavaObject)

Performs an Android runtime-checked type conversion.

JavaCast<TResult>(IJavaObject) JavaCast<TResult>(IJavaObject)
GetJniTypeName(IJavaPeerable) GetJniTypeName(IJavaPeerable)
Append(IAppendable, String) Append(IAppendable, String)
Append(IAppendable, String, Int32, Int32) Append(IAppendable, String, Int32, Int32)
SubSequence(ICharSequence, Int32, Int32) SubSequence(ICharSequence, Int32, Int32)

Applies to