public class SimpleString extends Object implements CharSequence, Serializable, Comparable<SimpleString>
| Constructor and Description |
|---|
SimpleString(byte[] data)
creates a SimpleString from a byte array
|
SimpleString(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(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(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.
|
CharSequence |
subSequence(int start,
int end) |
static SimpleString |
toSimpleString(String string)
Returns a SimpleString constructed from the
string parameter. |
String |
toString() |
public SimpleString(String string)
string - the string to transformpublic SimpleString(byte[] data)
data - the byte array to usepublic static SimpleString toSimpleString(String string)
string parameter.
If string is null, the return value will be null too.public int length()
length in interface CharSequencepublic char charAt(int pos)
charAt in interface CharSequencepublic CharSequence subSequence(int start, int end)
subSequence in interface CharSequencepublic int compareTo(SimpleString o)
compareTo in interface Comparable<SimpleString>public byte[] getData()
public boolean startsWith(SimpleString other)
other - the SimpelString to look forpublic String toString()
toString in interface CharSequencetoString in class Objectpublic SimpleString[] split(char delim)
delim - public boolean contains(char c)
c - the char to check forpublic SimpleString concat(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 © 2012 JBoss by Red Hat. All Rights Reserved.