|
RoboJDETM v2.0 | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.String
public class String
An object representing an immutable character string.
This implementation uses an ASCII representation internally. It does not support unicode strings.
Constructor Summary | |
---|---|
String()
Constructs a String object of zero length. |
|
String(byte[] bytes)
Constructs a String object from the provided byte array assuming the array contains ASCII data. |
|
String(byte[] bytes,
int offset,
int length)
Constructs a String object from the provided byte array assuming the array contains ASCII data. |
|
String(char[] chars)
Constructs a String object from characters in the provided character array assuming the characters are ASCII. |
|
String(char[] chars,
int offset,
int count)
Constructs a String object from characters in the provided character array assuming the characters are ASCII. |
|
String(String string)
Constructs a new String object from the provided string object. |
Method Summary | |
---|---|
boolean |
equals(Object o)
Returns true if the specified object is a String of the same characters as this String. |
byte[] |
getBytes()
Returns a clone of the ASCII bytes which represent this String. |
void |
getBytes(int beginIndex,
int endIndex,
byte[] bytes,
int destinationIndex)
Copies bytes from this string to the specified byte buffer. |
int |
hashCode()
Returns a hash code generated from the characters that make up this String. |
int |
length()
Returns the count of characters in this String. |
char[] |
toCharArray()
Returns a character array containing the characters in this String. |
String |
toString()
Returns a pointer to this object. |
static String |
valueOf(Object o)
Returns toString() of the specified object. |
Methods inherited from class java.lang.Object |
---|
clone, getClass, notify, notifyAll, wait, wait |
Constructor Detail |
---|
public String()
public String(byte[] bytes)
bytes
- bytes representing the character stringpublic String(byte[] bytes, int offset, int length)
bytes
- bytes representing the character stringoffset
- offset of the first byte in the array to uselength
- number of bytes to usepublic String(char[] chars)
chars
- character arraypublic String(char[] chars, int offset, int count)
chars
- character arrayoffset
- offset of the first character in the array to usecount
- number of characters to usepublic String(String string)
string
- a String objectMethod Detail |
---|
public boolean equals(Object o)
equals
in class Object
o
- object to compare to
public byte[] getBytes()
public void getBytes(int beginIndex, int endIndex, byte[] bytes, int destinationIndex)
beginIndex
- starting index in this StringendIndex
- ending index in this Stringbytes
- destination bufferdestinationIndex
- starting index into destination bufferpublic int hashCode()
hashCode
in class Object
public int length()
public char[] toCharArray()
public String toString()
toString
in class Object
public static String valueOf(Object o)
o
- object
|
RoboJDETM v2.0 | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |