public class Text extends Object implements CharSequence
| Modifier and Type | Field and Description |
|---|---|
protected byte[] |
chars |
protected int |
len |
protected int |
pos |
| Modifier | Constructor and Description |
|---|---|
|
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.
|
| Modifier and Type | Method and Description |
|---|---|
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 |
hexToInteger() |
int |
indexOf(char value) |
int |
indexOf(Text value) |
int |
length()
(Non Java-doc.)
|
Text |
nextLine()
Extracts next line from this text.
|
Collection<Text> |
split(char separator)
Splits text into partitions.
|
Collection<Text> |
split(Text separator)
Splits text into partitions.
|
boolean |
startsWith(Text pattern)
Indicates whether the text starts with a certain pattern.
|
void |
strain(byte[] data,
int pos,
int len)
Strains this object into the memory area.
|
CharSequence |
subSequence(int start,
int end)
(Non Java-doc.)
|
Text |
subtext(int start) |
Text |
subtext(int start,
int end) |
int |
toInteger()
Converts string value to integer
|
long |
toLong()
Converts string value to long
|
String |
toString() |
void |
trim()
Removes whitespace from the head and tail of the string.
|
void |
write(ByteBuffer buffer)
Writes this text into byte buffer.
|
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 positionpublic 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 textpublic int divide(char[] separators,
Text[] parts)
public CharSequence subSequence(int start, int end)
subSequence in interface CharSequenceCharSequence.subSequence(int, int);public Text subtext(int start, int end)
public Text subtext(int start)
public Collection<Text> split(char separator)
separator - character used for partitioningpublic Collection<Text> split(Text separator)
separator - character used for partitioningpublic int indexOf(Text value)
public int indexOf(char value)
public void trim()
public Text nextLine()
public boolean hasMoreLines()
public boolean startsWith(Text pattern)
pattern - The pattern to matchtrue if this text starts with the pattern.
Otherwise, or if the pattern is null, returns false.public String toString()
toString in interface CharSequencetoString in class Objectpublic int toInteger()
throws NumberFormatException
NumberFormatExceptionpublic long toLong()
throws NumberFormatException
NumberFormatExceptionpublic int hexToInteger()
throws NumberFormatException
NumberFormatExceptionpublic 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.Copyright © 2017 TeleStax, Inc.. All Rights Reserved.