net.rim.device.api.util
Interface AbstractString

All Known Implementing Classes:
AbstractStringWrapper

public interface AbstractString

Defines a set of utility methods for string data.


Method Summary
 char charAt(int index)
          Retrieves character at provided position.
 void getChars(int srcBegin, int srcEnd, char[] dst, int dstBegin)
          Retrieves substring into provided array.
 int indexOf(char c, int startIndex, int endIndex)
          Retrieves position of first matching character in substring.
 int length()
          Retrieves the number of characters in this string.
 

Method Detail

charAt

public char charAt(int index)
Retrieves character at provided position.

Parameters:
index - Number of characters after first in string.
Returns:
Character found at provided position.

getChars

public void getChars(int srcBegin,
                     int srcEnd,
                     char[] dst,
                     int dstBegin)
Retrieves substring into provided array.

Parameters:
srcBegin - First character in this string to copy.
srcEnd - Last character in this string to copy; must be after the srcBegin parameter.
dst - Character array to receive the characters in the substring; must be large enough to receive the expected number of characters.
dstBegin - Position within the dst array parameter at which to begin copying characters from this string; if not 0, then the length of dst must be at least dstBegin + (srcEnd - srcBegin).

indexOf

public int indexOf(char c,
                   int startIndex,
                   int endIndex)
Retrieves position of first matching character in substring.

Parameters:
c - Character to match.
startIndex - First character in string to check.
endIndex - Last character in string to check; must be after the startIndex parameter.
Returns:
Position of first instance of character in substring; or -1 if no match found.

length

public int length()
Retrieves the number of characters in this string.

Returns:
Length in characters of this string.



Copyright 1999-2009 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.