aicas logo Jamaica 3.4 release 8

sun.text.normalizer
Class ReplaceableString

java.lang.Object
  extended by sun.text.normalizer.ReplaceableString
All Implemented Interfaces:
Replaceable

public class ReplaceableString
extends Object
implements Replaceable

ReplaceableString is an adapter class that implements the Replaceable API around an ordinary StringBuffer.

Note: This class does not support attributes and is not intended for general use. Most clients will need to implement Replaceable in their text representation class.

Copyright © IBM Corporation 1999. All rights reserved.

See Also:
Replaceable

Constructor Summary
ReplaceableString(String str)
          Construct a new object with the given initial contents.
ReplaceableString(StringBuffer buf)
          Construct a new object using buf for internal storage.
 
Method Summary
 char charAt(int offset)
          Return the character at the given position in this object.
 void getChars(int srcStart, int srcLimit, char[] dst, int dstStart)
          Copies characters from this object into the destination character array.
 int length()
          Return the number of characters contained in this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReplaceableString

public ReplaceableString(String str)
Construct a new object with the given initial contents.

Parameters:
str - initial contents

ReplaceableString

public ReplaceableString(StringBuffer buf)
Construct a new object using buf for internal storage. The contents of buf at the time of construction are used as the initial contents. Note! Modifications to buf will modify this object, and vice versa.

Parameters:
buf - object to be used as internal storage
Method Detail

length

public int length()
Return the number of characters contained in this object. Replaceable API.

Specified by:
length in interface Replaceable
Returns:
number of 16-bit code units in text

charAt

public char charAt(int offset)
Return the character at the given position in this object. Replaceable API.

Specified by:
charAt in interface Replaceable
Parameters:
offset - offset into the contents, from 0 to length() - 1
Returns:
16-bit code unit of text at given offset

getChars

public void getChars(int srcStart,
                     int srcLimit,
                     char[] dst,
                     int dstStart)
Copies characters from this object into the destination character array. The first character to be copied is at index srcStart; the last character to be copied is at index srcLimit-1 (thus the total number of characters to be copied is srcLimit-srcStart). The characters are copied into the subarray of dst starting at index dstStart and ending at index dstStart + (srcLimit-srcStart) - 1.

Specified by:
getChars in interface Replaceable
Parameters:
srcStart - the beginning index to copy, inclusive; 0 <= start <= limit.
srcLimit - the ending index to copy, exclusive; start <= limit <= length().
dst - the destination array.
dstStart - the start offset in the destination array.

aicas logo Jamaica 3.4 release 8

aicas GmbH, Karlsruhe - Germany    www.aicas.com
Copyright 2001-2009 aicas GmbH. All Rights Reserved.