|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.hornetq.api.core.SimpleString
public class SimpleString
A simple String class that can store all characters, and stores as simple byte[], this minimises expensive copying between String objects. This object is used heavily throughout HornetQ for performance reasons.
Constructor Summary | |
---|---|
SimpleString(byte[] data)
creates a SimpleString from a byte array |
|
SimpleString(String string)
creates a SimpleString from a conventional String |
Method Summary | |
---|---|
char |
charAt(int pos)
|
int |
compareTo(SimpleString o)
|
SimpleString |
concat(char c)
concatanates a SimpleString and a char |
SimpleString |
concat(SimpleString toAdd)
concatanates 2 SimpleString's |
SimpleString |
concat(String toAdd)
concatanates 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 delimeter. |
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()
|
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public SimpleString(String string)
string
- the string to transformpublic SimpleString(byte[] data)
data
- the byte array to useMethod Detail |
---|
public static SimpleString toSimpleString(String string)
string
parameter.
If string
is null
, the return value will be null
too.
public int length()
length
in interface CharSequence
public char charAt(int pos)
charAt
in interface CharSequence
public CharSequence subSequence(int start, int end)
subSequence
in interface CharSequence
public int compareTo(SimpleString o)
compareTo
in interface Comparable<SimpleString>
public byte[] getData()
public boolean startsWith(SimpleString other)
other
- the SimpelString to look for
public String toString()
toString
in interface CharSequence
toString
in class Object
public boolean equals(Object other)
equals
in class Object
public int hashCode()
hashCode
in class Object
public SimpleString[] split(char delim)
delim
- public boolean contains(char c)
c
- the char to check for
public SimpleString concat(String toAdd)
toAdd
- the String to concate with.
public SimpleString concat(SimpleString toAdd)
toAdd
- the SimpleString to concate 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 check
public static int sizeofNullableString(SimpleString str)
str
- the SimpleString to check
public void getChars(int srcBegin, int srcEnd, char[] dst, int dstBegin)
srcBegin
- srcEnd
- dst
- dstBegin
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |