Javolution 6.0.0 java
|
Public Member Functions | |
CharArray () | |
CharArray (int capacity) | |
CharArray (String string) | |
char[] | array () |
int | length () |
int | offset () |
CharArray | setArray (char[] array, int offset, int length) |
final int | indexOf (java.lang.CharSequence csq) |
final int | indexOf (char c) |
String | toString () |
int | hashCode () |
boolean | equals (Object that) |
boolean | equals (CharArray that) |
boolean | equals (String str) |
int | compareTo (CharSequence seq) |
boolean | toBoolean () |
int | toInt () |
int | toInt (int radix) |
long | toLong () |
long | toLong (int radix) |
float | toFloat () |
double | toDouble () |
char | charAt (int index) |
java.lang.CharSequence | subSequence (int start, int end) |
void | getChars (int start, int end, char dest[], int destPos) |
Private Member Functions | |
boolean | equals (java.lang.CharSequence chars) |
Private Attributes | |
char[] | _array |
int | _offset |
int | _length |
Static Private Attributes | |
static final char[] | NO_CHAR = new char[0] |
A CharSequence backed up by a char
array. Instances of this class are typically used/reused to provide CharSequence
views over existing character buffers.
Instances of this classes have the following properties:
They support equality or lexical comparison with any CharSequence
(e.g. String
).
They have the same hashcode than String
and can be used to retrieve data from maps for which the keys are String
instances.
They support fast conversions to primitive types (e.g. Boolean, int).
Definition at line 36 of file CharArray.java.
javolution.text.CharArray.CharArray | ( | ) |
Default constructor (empty character array).
Definition at line 56 of file CharArray.java.
References javolution.text.CharArray._array, and javolution.text.CharArray.NO_CHAR.
Referenced by javolution.text.CharArray.subSequence().
javolution.text.CharArray.CharArray | ( | int | capacity | ) |
Creates a character array of specified default capacity.
capacity | the backing array default capacity. |
Definition at line 67 of file CharArray.java.
References javolution.text.CharArray._array.
javolution.text.CharArray.CharArray | ( | String | string | ) |
Creates a character array from the specified String.
string | the string source. |
Definition at line 76 of file CharArray.java.
References javolution.text.CharArray._array, and javolution.text.CharArray._length.
char [] javolution.text.CharArray.array | ( | ) |
Returns the underlying array.
Definition at line 86 of file CharArray.java.
References javolution.text.CharArray._array.
Referenced by javolution.xml.internal.stream.XMLStreamReaderImpl.getTextCharacters(), javolution.xml.internal.stream.XMLStreamReaderImpl.isWhiteSpace(), javolution.xml.sax.XMLReaderImpl.parseAll(), javolution.io.CharSequenceReader.read(), javolution.xml.internal.stream.XMLStreamReaderImpl.readPrologAttribute(), javolution.text.CharArray.setArray(), and javolution.xml.internal.stream.NamespacesImpl.setPrefix().
char javolution.text.CharArray.charAt | ( | int | index | ) |
Definition at line 369 of file CharArray.java.
References javolution.text.CharArray._array, javolution.text.CharArray._length, and javolution.text.CharArray._offset.
Referenced by javolution.xml.XMLFormat< T >.InputElement.getAttribute(), and javolution.xml.internal.stream.XMLStreamReaderImpl.isXMLNS().
int javolution.text.CharArray.compareTo | ( | CharSequence | seq | ) |
Compares this character array with the specified character sequence lexicographically.
seq | the character sequence to be compared. |
Equalities#LEXICAL.compare(this, seq)
ClassCastException | if the specifed object is not a CharSequence . |
Definition at line 281 of file CharArray.java.
References javolution.util.function.Equality< T >.compare(), and javolution.util.function.Equalities.LEXICAL.
boolean javolution.text.CharArray.equals | ( | CharArray | that | ) |
Compares this character array against the specified CharArray.
that | the character array to compare with. |
true
if both objects represent the same sequence; false
otherwise. Definition at line 236 of file CharArray.java.
References javolution.text.CharArray._array, javolution.text.CharArray._length, and javolution.text.CharArray._offset.
|
private |
Definition at line 217 of file CharArray.java.
References javolution.text.CharArray._array, javolution.text.CharArray._length, and javolution.text.CharArray._offset.
boolean javolution.text.CharArray.equals | ( | Object | that | ) |
Compares this character sequence against the specified object (String
or CharSequence
).
that | the object to compare with. |
true
if both objects represent the same sequence; false
otherwise. Definition at line 204 of file CharArray.java.
Referenced by javolution.xml.XMLFormat< T >.InputElement.get(), javolution.xml.XMLFormat< T >.InputElement.getNext(), javolution.xml.internal.stream.NamespacesImpl.getPrefix(), javolution.xml.internal.stream.XMLStreamWriterImpl.getRepairedPrefix(), javolution.xml.ws.WebServiceClient.invoke(), javolution.xml.internal.stream.XMLStreamReaderImpl.isStandalone(), javolution.xml.internal.stream.XMLStreamReaderImpl.processEndTag(), javolution.xml.ws.WebServiceClient.readResponse(), javolution.xml.internal.stream.XMLStreamReaderImpl.setInput(), javolution.xml.internal.stream.XMLStreamWriterImpl.writeAttributeOrNamespace(), javolution.xml.internal.stream.XMLStreamWriterImpl.writeNamespace(), javolution.xml.internal.stream.XMLStreamWriterImpl.writeNamespaces(), and javolution.xml.internal.stream.XMLStreamWriterImpl.writeNewElement().
boolean javolution.text.CharArray.equals | ( | String | str | ) |
Compares this character array against the specified String. In case of equality, the CharArray keeps a reference to the String for future comparisons.
str | the string to compare with. |
true
if both objects represent the same sequence; false
otherwise. Definition at line 260 of file CharArray.java.
References javolution.text.CharArray._array, javolution.text.CharArray._length, and javolution.text.CharArray._offset.
void javolution.text.CharArray.getChars | ( | int | start, |
int | end, | ||
char | dest[], | ||
int | destPos | ||
) |
Definition at line 387 of file CharArray.java.
References javolution.text.CharArray._array, javolution.text.CharArray._length, and javolution.text.CharArray._offset.
int javolution.text.CharArray.hashCode | ( | ) |
Returns the hash code for this CharArray.
Note: Returns the same hashCode as java.lang.String
(consistent with equals)
Definition at line 187 of file CharArray.java.
References javolution.text.CharArray._array, javolution.text.CharArray._length, and javolution.text.CharArray._offset.
final int javolution.text.CharArray.indexOf | ( | char | c | ) |
Returns the index within this character sequence of the first occurrence of the specified character searching forward.
c | the character to search for. |
[0, length()[
or -1
if the character is not found. Definition at line 159 of file CharArray.java.
References javolution.text.CharArray._array, javolution.text.CharArray._length, and javolution.text.CharArray._offset.
final int javolution.text.CharArray.indexOf | ( | java.lang.CharSequence | csq | ) |
Returns the index within this character sequence of the first occurrence of the specified characters sequence searching forward.
csq | a character sequence searched for. |
[0, length()[
or -1
if the character sequence is not found. Definition at line 132 of file CharArray.java.
References javolution.text.CharArray._array, javolution.text.CharArray._length, and javolution.text.CharArray._offset.
Referenced by javolution.xml.internal.stream.XMLStreamReaderImpl.getPIData(), javolution.xml.internal.stream.XMLStreamReaderImpl.getPITarget(), and javolution.xml.internal.stream.XMLStreamReaderImpl.readPrologAttribute().
int javolution.text.CharArray.length | ( | ) |
Returns the length of this character sequence.
Definition at line 95 of file CharArray.java.
References javolution.text.CharArray._length.
Referenced by javolution.xml.XMLFormat< T >.InputElement.getAttribute(), javolution.xml.internal.stream.XMLStreamReaderImpl.getElementText(), javolution.xml.internal.stream.XMLStreamReaderImpl.getLocalName(), javolution.xml.internal.stream.XMLStreamReaderImpl.getPIData(), javolution.xml.internal.stream.XMLStreamReaderImpl.getTextCharacters(), javolution.xml.internal.stream.XMLStreamReaderImpl.getTextLength(), javolution.xml.internal.stream.XMLStreamReaderImpl.hasText(), javolution.xml.internal.stream.XMLStreamReaderImpl.increaseStack(), javolution.xml.internal.stream.XMLStreamReaderImpl.isEndOfStream(), javolution.xml.internal.stream.XMLStreamReaderImpl.isWhiteSpace(), javolution.xml.internal.stream.XMLStreamReaderImpl.isXMLNS(), javolution.xml.internal.stream.XMLStreamReaderImpl.next(), javolution.xml.sax.XMLReaderImpl.parseAll(), javolution.xml.internal.stream.XMLStreamReaderImpl.processAttribute(), javolution.xml.internal.stream.XMLStreamReaderImpl.processStartTag(), javolution.xml.internal.stream.XMLStreamReaderImpl.readPrologAttribute(), javolution.xml.internal.stream.NamespacesImpl.resizePrefixStack(), javolution.text.CharArray.setArray(), javolution.xml.internal.stream.XMLStreamReaderImpl.setInput(), javolution.xml.internal.stream.NamespacesImpl.setPrefix(), javolution.text.CharArray.subSequence(), and javolution.xml.internal.stream.XMLStreamWriterImpl.writeNamespaces().
int javolution.text.CharArray.offset | ( | ) |
Returns the offset of the first character in the underlying array.
Definition at line 104 of file CharArray.java.
References javolution.text.CharArray._offset.
Referenced by javolution.xml.internal.stream.XMLStreamReaderImpl.getElementText(), javolution.xml.internal.stream.XMLStreamReaderImpl.getLocalName(), javolution.xml.internal.stream.XMLStreamReaderImpl.getPIData(), javolution.xml.internal.stream.XMLStreamReaderImpl.getPITarget(), javolution.xml.internal.stream.XMLStreamReaderImpl.getPrefix(), javolution.xml.internal.stream.XMLStreamReaderImpl.getTextCharacters(), javolution.xml.internal.stream.XMLStreamReaderImpl.getTextStart(), javolution.xml.internal.stream.XMLStreamReaderImpl.isEndOfStream(), javolution.xml.internal.stream.XMLStreamReaderImpl.isWhiteSpace(), javolution.xml.internal.stream.XMLStreamReaderImpl.next(), javolution.xml.sax.XMLReaderImpl.parseAll(), javolution.xml.internal.stream.XMLStreamReaderImpl.processAttribute(), javolution.io.CharSequenceReader.read(), javolution.xml.internal.stream.XMLStreamReaderImpl.readPrologAttribute(), javolution.text.CharArray.setArray(), and javolution.xml.internal.stream.XMLStreamReaderImpl.setInput().
CharArray javolution.text.CharArray.setArray | ( | char[] | array, |
int | offset, | ||
int | length | ||
) |
Sets the underlying array of this CharArray.
offset | the new offset. |
array | the new underlying array. |
length | the new length. |
this
Definition at line 116 of file CharArray.java.
References javolution.text.CharArray._array, javolution.text.CharArray._length, javolution.text.CharArray._offset, javolution.text.CharArray.array(), javolution.text.CharArray.length(), and javolution.text.CharArray.offset().
Referenced by javolution.xml.internal.stream.XMLStreamReaderImpl.getElementText(), javolution.xml.internal.stream.XMLStreamReaderImpl.isEndOfStream(), javolution.xml.internal.stream.XMLStreamReaderImpl.newSeq(), javolution.xml.internal.stream.XMLStreamReaderImpl.next(), javolution.xml.internal.stream.EntitiesImpl.replaceEntity(), javolution.xml.internal.stream.NamespacesImpl.setPrefix(), javolution.text.TextBuilder.toCharArray(), and javolution.xml.internal.stream.XMLStreamWriterImpl.writeCharacters().
java.lang.CharSequence javolution.text.CharArray.subSequence | ( | int | start, |
int | end | ||
) |
Definition at line 376 of file CharArray.java.
References javolution.text.CharArray._array, javolution.text.CharArray._length, javolution.text.CharArray._offset, javolution.text.CharArray.CharArray(), and javolution.text.CharArray.length().
boolean javolution.text.CharArray.toBoolean | ( | ) |
Returns the boolean
represented by this character array.
boolean
value. NumberFormatException | if this character sequence does not contain a parsable boolean . |
Definition at line 292 of file CharArray.java.
References javolution.text.TypeFormat.parseBoolean().
Referenced by javolution.xml.XMLFormat< T >.InputElement.getAttribute().
double javolution.text.CharArray.toDouble | ( | ) |
Returns the double
represented by this character array.
double
value. NumberFormatException | if this character sequence does not contain a parsable double . |
Definition at line 364 of file CharArray.java.
References javolution.text.TypeFormat.parseDouble().
Referenced by javolution.xml.XMLFormat< T >.InputElement.getAttribute().
float javolution.text.CharArray.toFloat | ( | ) |
Returns the float
represented by this character array.
float
value. TypeFormat.parseFloat(this)
NumberFormatException | if this character sequence does not contain a parsable float . |
Definition at line 353 of file CharArray.java.
References javolution.text.TypeFormat.parseFloat().
Referenced by javolution.xml.XMLFormat< T >.InputElement.getAttribute().
int javolution.text.CharArray.toInt | ( | ) |
Returns the decimal int
represented by this character array.
toInt(10)
NumberFormatException | if this character sequence does not contain a parsable int . |
Definition at line 303 of file CharArray.java.
References javolution.text.TypeFormat.parseInt().
Referenced by javolution.xml.XMLReferenceResolver.createReference(), javolution.xml.XMLFormat< T >.InputElement.getAttribute(), and javolution.xml.XMLReferenceResolver.readReference().
int javolution.text.CharArray.toInt | ( | int | radix | ) |
Returns the int
represented by this character array in the specified radix.
radix | the radix (e.g. 16 for hexadecimal). |
int
value. NumberFormatException | if this character sequence does not contain a parsable int . |
Definition at line 316 of file CharArray.java.
References javolution.text.TypeFormat.parseInt().
long javolution.text.CharArray.toLong | ( | ) |
Returns the decimal long
represented by this character array.
long
value. NumberFormatException | if this character sequence does not contain a parsable long . |
Definition at line 328 of file CharArray.java.
References javolution.text.TypeFormat.parseLong().
Referenced by javolution.xml.XMLFormat< T >.InputElement.getAttribute().
long javolution.text.CharArray.toLong | ( | int | radix | ) |
Returns the decimal long
represented by this character array in the specified radix.
radix | the radix (e.g. 16 for hexadecimal). |
long
value. NumberFormatException | if this character sequence does not contain a parsable long . |
Definition at line 341 of file CharArray.java.
References javolution.text.TypeFormat.parseLong().
String javolution.text.CharArray.toString | ( | ) |
Returns the String
corresponding to this character sequence. The
String
returned is always allocated on the heap and can safely be referenced elsewhere.
java.lang.String
for this character sequence. Definition at line 175 of file CharArray.java.
References javolution.text.CharArray._array, javolution.text.CharArray._length, and javolution.text.CharArray._offset.
Referenced by javolution.xml.XMLFormat< T >.InputElement.getAttribute(), javolution.xml.sax.SAX2ReaderImpl.Proxy.getType(), and javolution.xml.internal.stream.XMLStreamReaderImpl.setInput().
|
private |
Holds the character array.
Definition at line 41 of file CharArray.java.
Referenced by javolution.text.CharArray.array(), javolution.text.CharArray.CharArray(), javolution.text.CharArray.charAt(), javolution.text.CharArray.equals(), javolution.text.CharArray.getChars(), javolution.text.CharArray.hashCode(), javolution.text.CharArray.indexOf(), javolution.text.CharArray.setArray(), javolution.text.CharArray.subSequence(), and javolution.text.CharArray.toString().
|
private |
Holds the length of char sequence.
Definition at line 51 of file CharArray.java.
Referenced by javolution.text.CharArray.CharArray(), javolution.text.CharArray.charAt(), javolution.text.CharArray.equals(), javolution.text.CharArray.getChars(), javolution.text.CharArray.hashCode(), javolution.text.CharArray.indexOf(), javolution.text.CharArray.length(), javolution.text.CharArray.setArray(), javolution.text.CharArray.subSequence(), and javolution.text.CharArray.toString().
|
private |
Holds the index of the first character.
Definition at line 46 of file CharArray.java.
Referenced by javolution.text.CharArray.charAt(), javolution.text.CharArray.equals(), javolution.text.CharArray.getChars(), javolution.text.CharArray.hashCode(), javolution.text.CharArray.indexOf(), javolution.text.CharArray.offset(), javolution.text.CharArray.setArray(), javolution.text.CharArray.subSequence(), and javolution.text.CharArray.toString().
|
staticprivate |
Definition at line 60 of file CharArray.java.
Referenced by javolution.text.CharArray.CharArray().