PATH  Documentation > Mac OS X > Foundation Reference: Java



Table of Contents

NSMutableStringReference


Inherits from:
NSStringReference : NSObject
Package:
com.apple.yellow.foundation


Class Description


The NSMutableStringReference class declares the programmatic interface to an object that manages a mutable string-that is, a string whose contents can be edited. To construct and manage an immutable string-or a string that cannot be changed after it has been created-use an object of the NSStringReference class.

An immutable string is implemented as array of Unicode characters (in other words, as a text string). The NSMutableStringReference class adds one primitive method- replaceCharactersInRange-to the basic string-handling behavior inherited from NSStringReference. All other methods that modify a string work through this method. For example, insertStringAtIndex simply replaces the characters in a range of zero length, while deleteCharactersInRange replaces the characters in a given range with no characters.




Method Types


Constructors
NSMutableStringReference
Modifying a string
appendString
deleteCharactersInRange
insertStringAtIndex
replaceCharactersInRange
setString


Constructors



NSMutableStringReference

public NSMutableStringReference()

Description forthcoming.

public NSMutableStringReference( NSData aData, int anInt)

Description forthcoming.

public NSMutableStringReference(java.net.URL anURL)

Description forthcoming.

public NSMutableStringReference( java.net.URL anURL, int anInt)

Description forthcoming.


Instance Methods



appendString

public void appendString(String aString)

Adds the characters of aString to the end of the receiver.

public void appendString(NSStringReference aStringReference)

Adds the characters of aStringReference to the end of the receiver.

deleteCharactersInRange

public void deleteCharactersInRange(NSRange aRange)

Removes the characters in aRange from the receiver. Throws a RangeException if any part of aRange lies beyond the end of the string.

insertStringAtIndex

public void insertStringAtIndex( String aString, int anIndex)

Inserts the characters of aString into the receiver, so the new characters begin at anIndex and the existing characters from anIndex to the end are shifted by the length of aString. Throws a RangeException if anIndex lies beyond the end of the string.

public void insertStringAtIndex( NSStringReference aStringReference, int anIndex)

Inserts the characters of aStringReference into the receiver, so the new characters begin at anIndex and the existing characters from anIndex to the end are shifted by the length of aString. Throws a RangeException if anIndex lies beyond the end of the string.

replaceCharactersInRange

public void replaceCharactersInRange( NSRange aRange, String aString)

Replaces the characters from aRange with those in aString. Throws a RangeException if any part of aRange lies beyond the end of the string.

public void replaceCharactersInRange( NSRange aRange, NSStringReference aStringReference)

Replaces the characters from aRange with those in aStringReference. Throws a RangeException if any part of aRange lies beyond the end of the string.

setString

public void setString(String aString)

Replaces the characters of the receiver with those in aString.

public void setString(NSStringReference aStringReference)

Replaces the characters of the receiver with those in aStringReference.


Table of Contents