|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mobicents.media.server.utils.Text
public class Text
Case insensitive text block representation. This class provides time deterministic and fast methods for creating and comparing short character strings like format names, attribute values, etc.
| Field Summary | |
|---|---|
protected byte[] |
chars
|
protected int |
len
|
protected int |
pos
|
| Constructor Summary | |
|---|---|
|
Text()
Create an empty text object. |
|
Text(byte[] data,
int pos,
int len)
Creates new instance and straining it into memory. |
|
Text(int i)
Creates new text matching to specified integer number. |
|
Text(String s)
Creates new instance with specified text. |
protected |
Text(Text another)
Creates new object with specified text. |
| Method Summary | |
|---|---|
char |
charAt(int index)
(Non Java-doc.) |
boolean |
contains(char c)
Checks does specified symbol is present in this text. |
void |
copy(Text destination)
Copies reference to another text object. |
void |
copyRemainder(Text other)
Copies substring from the current line upto the end to the specified destination. |
int |
divide(char[] separators,
Text[] parts)
|
int |
divide(char separator,
Text[] parts)
Divides text into parts using given separator and writes results into the parts array. |
void |
duplicate(Text destination)
Copies data from this buffer to another buffer. |
boolean |
equals(Object other)
|
int |
hashCode()
|
boolean |
hasMoreLines()
Shows is this text contains more lines. |
int |
length()
(Non Java-doc.) |
Text |
nextLine()
Extracts next line from this text. |
Collection<Text> |
split(char separator)
Splits text into partitions. |
void |
strain(byte[] data,
int pos,
int len)
Strains this object into the memory area. |
CharSequence |
subSequence(int start,
int end)
(Non Java-doc.) |
int |
toInteger()
Converts string value to integer |
String |
toString()
|
void |
trim()
Removes whitespace from the head and tail of the string. |
void |
write(ByteBuffer buffer)
Writes this text into byte buffer. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected byte[] chars
protected int pos
protected int len
| Constructor Detail |
|---|
public Text()
protected Text(Text another)
another - the text object.public Text(String s)
s - the text value.public Text(int i)
i - the integer number.
public Text(byte[] data,
int pos,
int len)
data - memorypos - initial positionlen - the length from the initial position| Method Detail |
|---|
public void strain(byte[] data,
int pos,
int len)
data - the memory areapos - the initial positionlen - the length of area to usepublic int length()
length in interface CharSequenceCharSequence.length()public char charAt(int index)
charAt in interface CharSequenceCharSequence.charAt(int)public void copy(Text destination)
destination - the another text objectpublic void duplicate(Text destination)
destination - the pointer to another buffer.
public int divide(char separator,
Text[] parts)
separator - the character used for splittingparts - the array used to hold parts of the text
public int divide(char[] separators,
Text[] parts)
public CharSequence subSequence(int start,
int end)
subSequence in interface CharSequenceCharSequence.subSequence(int, int);public Collection<Text> split(char separator)
separator - character used for partitioning
public void trim()
public Text nextLine()
public boolean hasMoreLines()
public boolean equals(Object other)
equals in class Objectpublic int hashCode()
hashCode in class Objectpublic String toString()
toString in interface CharSequencetoString in class Objectpublic int toInteger()
public void write(ByteBuffer buffer)
buffer - the buffer for writing.public void copyRemainder(Text other)
other - the destination objectpublic boolean contains(char c)
c - the character to verify.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||