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

length

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

Returns:
Length in characters of this string.

indexOf

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.

charAt

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

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).





Copyright 1999-2011 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Java is a trademark of Oracle America Inc. in the US and other countries.
Legal