public class SimpleString extends java.lang.Object implements java.lang.CharSequence, java.io.Serializable, java.lang.Comparable<SimpleString>
Constructor and Description |
---|
SimpleString(byte[] data)
creates a SimpleString from a byte array
|
SimpleString(java.lang.String string)
creates a SimpleString from a conventional String
|
Modifier and Type | Method and Description |
---|---|
char |
charAt(int pos) |
int |
compareTo(SimpleString o) |
SimpleString |
concat(char c)
Concatenates a SimpleString and a char
|
SimpleString |
concat(SimpleString toAdd)
Concatenates 2 SimpleString's
|
SimpleString |
concat(java.lang.String toAdd)
Concatenates a SimpleString and a String
|
boolean |
contains(char c)
checks to see if this SimpleString contains the char parameter passed in
|
boolean |
equals(java.lang.Object other) |
void |
getChars(int srcBegin,
int srcEnd,
char[] dst,
int dstBegin) |
byte[] |
getData()
returns the underlying byte array of this SimpleString
|
int |
hashCode() |
int |
length() |
int |
sizeof()
returns the size of this SimpleString
|
static int |
sizeofNullableString(SimpleString str)
returns the size of a SimpleString which could be null
|
static int |
sizeofString(SimpleString str)
returns the size of a SimpleString
|
SimpleString[] |
split(char delim)
Splits this SimpleString into an array of SimpleString using the char param as the delimiter.
|
boolean |
startsWith(SimpleString other)
returns true if the SimpleString parameter starts with the same data as this one.
|
java.lang.CharSequence |
subSequence(int start,
int end) |
static SimpleString |
toSimpleString(java.lang.String string)
Returns a SimpleString constructed from the
string parameter. |
java.lang.String |
toString() |
public SimpleString(java.lang.String string)
string
- the string to transformpublic SimpleString(byte[] data)
data
- the byte array to usepublic static SimpleString toSimpleString(java.lang.String string)
string
parameter.
If string
is null
, the return value will be null
too.public int length()
length
in interface java.lang.CharSequence
public char charAt(int pos)
charAt
in interface java.lang.CharSequence
public java.lang.CharSequence subSequence(int start, int end)
subSequence
in interface java.lang.CharSequence
public int compareTo(SimpleString o)
compareTo
in interface java.lang.Comparable<SimpleString>
public byte[] getData()
public boolean startsWith(SimpleString other)
other
- the SimpelString to look forpublic java.lang.String toString()
toString
in interface java.lang.CharSequence
toString
in class java.lang.Object
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public SimpleString[] split(char delim)
delim
- public boolean contains(char c)
c
- the char to check forpublic SimpleString concat(java.lang.String toAdd)
toAdd
- the String to concatenate with.public SimpleString concat(SimpleString toAdd)
toAdd
- the SimpleString to concatenate with.public SimpleString concat(char c)
c
- the char to concate with.public int sizeof()
public static int sizeofString(SimpleString str)
str
- the SimpleString to checkpublic static int sizeofNullableString(SimpleString str)
str
- the SimpleString to checkpublic void getChars(int srcBegin, int srcEnd, char[] dst, int dstBegin)
srcBegin
- srcEnd
- dst
- dstBegin
- Copyright © 2009 Red Hat Inc. All Rights Reserved.