ALox  V. 2402 R. 0
Home ALox for C++ ALox for C# ALox for Java Download
Public Fields | Protected Fields | List of all members
Substring Class Reference
Inheritance diagram for Substring:
[legend]
Collaboration diagram for Substring:
[legend]

Class Description


This class is used for defining a region (sub-string) on an existing character array which is provided. This class will not manipulate the underlying data. In particular, there is no terminating zero written into the data.

The represented region is defined by the two fields start and end. The fields are public accessible. In general, while working with a Substring, the size of it should shrink, e.g. by trimming but should not grow. However, if the code using this class is "sure" that enlarging the region does violate the bounds of the buffer, fields start and end might be modified from outside.

If created or set using a reference of class AString, the buffer of AString is not copied. This allows efficient operations on sub-strings of class AString. However, the source string must not be changed (or only in a controlled way) during the use the Substring instance.

Objects of this class can be reused by freshly initializing them using one of the overloaded set methods.

Note
To generate Substrings which are separated by a delimiter character within a character array, use class Tokenizer.
Note
In the Java and C# versions of ALib, due to the language design, fields start and end have to be used to define the substring on a field buf, the character buffer. This forces a reimplementation of a bigger portion of the interface of class AString. In the C++ version of ALib, there is a richer family of string classes that fully integrates with zero terminated C strings, standard C++ strings and 3rd party string libraries. Neither the fields start and end are necessary, nor the aforementioned reimplementation. Consequently, when directly accessing public fields buf, start and end, the code gets incompatible to C++ code.

Public Fields

char[] buf
 
double consumedFloat
 
long consumedLong
 
int end
 
int start
 

Public Methods

Constructors

 Substring ()
 
 Substring (Substring substring)
 
 Substring (AString src, int regionStart, int regionLength)
 
 Substring (AString src, int regionStart)
 
 Substring (AString src)
 
 Substring (char[] src, int regionStart, int regionLength)
 
 Substring (char[] src, int regionStart)
 
 Substring (char[] src)
 
 Substring (String src, int regionStart, int regionLength)
 
 Substring (String src, int regionStart)
 
 Substring (String src)
 
Set data

Substring set (Substring src, int regionStart, int regionLength)
 
Substring set (Substring src, int regionStart)
 
Substring set (Substring src)
 
Substring set (AString src, int regionStart, int regionLength)
 
Substring set (AString src, int regionStart)
 
Substring set (AString src)
 
Substring set (char[] src, int regionStart, int regionLength)
 
Substring set (char[] src, int regionStart)
 
Substring set (char[] src)
 
Substring set (String src, int regionStart, int regionLength)
 
Substring set (String src, int regionStart)
 
Substring set (String src)
 
State and Character Access

int length ()
 
void setNull ()
 
void clear ()
 
boolean isNull ()
 
boolean isNotNull ()
 
boolean isEmpty ()
 
boolean isNotEmpty ()
 
char charAtStart ()
 
char charAtEnd ()
 
char charAtEnd (int n)
 
Consume

char consumeChar ()
 
char consumeCharFromEnd ()
 
int consumeCharFromEnd (int regionLength, Substring target)
 
int consumeCharFromEnd (int regionLength)
 
boolean consumeChar (char consumable, Case sensitivity, Whitespaces trimBeforeConsume)
 
boolean consumeChar (char consumable, Case sensitivity)
 
boolean consumeChar (char consumable)
 
boolean consumeCharFromEnd (char consumable, Case sensitivity, Whitespaces trimBeforeConsume)
 
boolean consumeCharFromEnd (char consumable, Case sensitivity)
 
boolean consumeCharFromEnd (char consumable)
 
int consumeChars (int regionLength, Substring target)
 
int consumeChars (int regionLength)
 
int consumeToken (Substring target, char separator)
 
boolean consumeString (CharSequence consumable, Case sensitivity, Whitespaces trimBeforeConsume)
 
boolean consumeString (CharSequence consumable, Case sensitivity)
 
boolean consumeString (CharSequence consumable)
 
boolean consumeStringFromEnd (CharSequence consumable, Case sensitivity, Whitespaces trimBeforeConsume)
 
boolean consumeStringFromEnd (CharSequence consumable, Case sensitivity)
 
boolean consumeStringFromEnd (CharSequence consumable)
 
int consumePartOf (String consumable, int minChars, Case sensitivity, Whitespaces trimBeforeConsume)
 
int consumePartOf (String consumable, int minChars, Case sensitivity)
 
int consumePartOf (String consumable, int minChars)
 
int consumePartOf (String consumable)
 
Substring consumeField (char startChar, char endChar, Substring target, Whitespaces trimBeforeConsume)
 
Substring consumeField (char startChar, char endChar, Substring target)
 
Substring split (int position, Substring target, int separatorWidth)
 
Comparison

int compareTo (CharSequence cmpString, Case sensitivity, int cmpRegionStart, int cmpRegionLength)
 
int compareTo (CharSequence cmpString, Case sensitivity, int cmpRegionStart)
 
int compareTo (CharSequence cmpString, Case sensitivity)
 
int compareTo (CharSequence cmpString)
 
boolean equals (Object object, Case sensitivity)
 
boolean equals (Object object)
 
boolean equals (AString cmpString, Case sensitivity)
 
boolean equals (AString cmpString)
 
boolean equals (String cmpString, Case sensitivity)
 
boolean equals (String cmpString)
 
boolean equals (Substring cmpString, Case sensitivity)
 
boolean equals (Substring cmpString)
 
boolean equals (CharSequence cmpString, Case sensitivity)
 
boolean equals (CharSequence cmpString)
 
boolean containsAt (CharSequence needle, int pos, Case sensitivity)
 
boolean containsAt (CharSequence needle, int pos)
 
boolean containsAt (AString needle, int pos, Case sensitivity)
 
boolean containsAt (AString needle, int pos)
 
boolean containsAt (Substring needle, int pos, Case sensitivity)
 
boolean containsAt (Substring needle, int pos)
 
boolean startsWith (CharSequence needle, Case sensitivity)
 
boolean startsWith (CharSequence needle)
 
boolean startsWith (AString needle, Case sensitivity)
 
boolean startsWith (AString needle)
 
boolean startsWith (Substring needle, Case sensitivity)
 
boolean startsWith (Substring needle)
 
boolean endsWith (CharSequence needle, Case sensitivity)
 
boolean endsWith (CharSequence needle)
 
boolean endsWith (AString needle, Case sensitivity)
 
boolean endsWith (AString needle)
 
boolean endsWith (Substring needle, Case sensitivity)
 
boolean endsWith (Substring needle)
 
Search

int indexOf (char needle, int startIdx)
 
int indexOf (char c)
 
int indexOfOrLength (char needle)
 
int indexOfOrLength (char needle, int startIdx)
 
int indexOf (CharSequence needle, int startIdx, Case sensitivity)
 
int indexOf (CharSequence cs, int startIdx)
 
int indexOf (CharSequence cs)
 
int indexOfFirstDifference (CharSequence needle, Case sensitivity, int startIdx)
 
int indexOfFirstDifference (CharSequence needle, Case sensitivity)
 
int indexOfFirstDifference (CharSequence needle)
 
int indexOfAny (char[] needles, Inclusion inclusion, int startIdx)
 
int indexOfAny (char[] needles, Inclusion inclusion)
 
int lastIndexOfAny (char[] needles, Inclusion inclusion, int startIdx)
 
int lastIndexOfAny (char[] needles, Inclusion inclusion)
 
Trim

Substring trimStart (char[] whiteSpaces)
 
Substring trimStart ()
 
Substring trimEnd (char[] whiteSpaces)
 
Substring trimEnd ()
 
Substring trim (char[] whiteSpaces)
 
Substring trim ()
 
Conversion

void copyTo (AString target, boolean append)
 
void copyTo (AString target)
 
String toString ()
 
String toString (int regionStart, int regionLength)
 
String toString (int regionStart)
 
boolean consumeDecDigits ()
 
boolean consumeInt (NumberFormat numberFormat)
 
boolean consumeInt ()
 
boolean consumeDec (NumberFormat numberFormat)
 
boolean consumeDec ()
 
boolean consumeBin (NumberFormat numberFormat)
 
boolean consumeBin ()
 
boolean consumeHex (NumberFormat numberFormat)
 
boolean consumeHex ()
 
boolean consumeOct (NumberFormat numberFormat)
 
boolean consumeOct ()
 
boolean consumeFloat (NumberFormat numberFormat)
 
boolean consumeFloat ()
 
Java CharSequence interface implementation

char charAt (int index)
 
CharSequence subSequence (int beginIndex, int endIndex)
 
int hashCode ()
 

Protected Fields

int[] _adjustedRegion = new int[2]
 

Constructor & Destructor Documentation

◆ Substring() [1/11]

Substring ( )

Empty Constructor. Sets this sub-string to 'null'

◆ Substring() [2/11]

Substring ( Substring  substring)

Copy constructor.

Parameters
substringThe substring to copy.

◆ Substring() [3/11]

Substring ( AString  src,
int  regionStart,
int  regionLength 
)

Constructs the Substring to be a region of given AString. If the provided values start and length get out of range, they get adjusted.

Parameters
srcThe string we work on.
regionStartThe start of the region within src. Defaults to 0.
regionLengthThe length of the region within src. Defaults to the length of src.

◆ Substring() [4/11]

Substring ( AString  src,
int  regionStart 
)

Constructs the Substring to be a region of given AString. If the provided values start and length get out of range, they get adjusted.

Parameters
srcThe string we work on.
regionStartThe start of the region within src. Defaults to 0.

◆ Substring() [5/11]

Substring ( AString  src)

Constructs the Substring on the given AString. Start and end markers will be cover all of AString. start and the end of the given AString.

Parameters
srcThe string we work with.

◆ Substring() [6/11]

Substring ( char[]  src,
int  regionStart,
int  regionLength 
)

Constructs the sub-string to work on the provided character array.

Parameters
srcThe string we work on.
regionStartThe start of the region within src. Defaults to 0.
regionLengthThe length of the region within src. Defaults to the length of src.

◆ Substring() [7/11]

Substring ( char[]  src,
int  regionStart 
)

Constructs the sub-string to work on the provided character array.

Parameters
srcThe string we work on.
regionStartThe start of the region within src. Defaults to 0.

◆ Substring() [8/11]

Substring ( char[]  src)

Constructs the sub-string to work on the provided character array.

Parameters
srcThe character array to work on.

◆ Substring() [9/11]

Substring ( String  src,
int  regionStart,
int  regionLength 
)

Constructs the sub-string to work on the provided String.

Parameters
srcThe string we work on.
regionStartThe start of the region within src. Defaults to 0.
regionLengthThe length of the region within src. Defaults to the length of src.

◆ Substring() [10/11]

Substring ( String  src,
int  regionStart 
)

Constructs the sub-string to work on the provided String.

Parameters
srcThe string we work on.
regionStartThe start of the region within src. Defaults to 0.

◆ Substring() [11/11]

Substring ( String  src)

Constructs the sub-string to work on the provided String.

Parameters
srcThe String to work on.

Member Function Documentation

◆ charAt()

char charAt ( int  index)

Returns a character of the sequence.

Parameters
indexThe index of the character to return.
Returns
The character at the given index. If this Substring empty or nulled, or if n is out of bounds, '\0' is returned.

◆ charAtEnd() [1/2]

char charAtEnd ( )

Retrieve the last character in the substring.

Returns
The character at the start of the represented region. If this Substring empty or nulled, '\0' is returned.

◆ charAtEnd() [2/2]

char charAtEnd ( int  n)

Retrieve the n-th character in the substring, counted from the end.

Parameters
nThe offset of the requested character. Attention: n is subtracted from the end. In other words, positive values peek towards the start of the region.
Returns
The n-th character counted from the end of the represented region backwards. If this Substring empty or nulled, or if n is out of bounds, '\0' is returned.

◆ charAtStart()

char charAtStart ( )

Retrieve the first character in the substring.

Returns
The character at the start of the represented region. If this Substring empty or nulled, '\0' is returned.

◆ clear()

void clear ( )

Sets the represented region to zero length by setting end to start -1.

◆ compareTo() [1/4]

int compareTo ( CharSequence  cmpString)

Compares a given string with this instance.

Parameters
cmpStringAn object of type String, StringBuffer or AString that is compared to this.
Returns
0 if string are equal. -1 if the instance precedes given string, 1 the instance follows the given string (same as String.CompareTo), or if given string in null.

◆ compareTo() [2/4]

int compareTo ( CharSequence  cmpString,
Case  sensitivity 
)

Compares a given string with this instance.

Parameters
cmpStringAn object of type String, StringBuffer or AString that is compared to this.
sensitivityCase sensitivity of the operation. Optional and defaults to Case.Sensitive.
Returns
0 if string are equal. -1 if the instance precedes given string, 1 the instance follows the given string (same as String.CompareTo), or if given string in null.

◆ compareTo() [3/4]

int compareTo ( CharSequence  cmpString,
Case  sensitivity,
int  cmpRegionStart 
)

Compares a given region of a string with this instance. Regions that are out of bounds get adjusted and then compared.

Parameters
cmpStringAn object of type String, StringBuffer or AString that is compared to this.
sensitivityCase sensitivity of the operation. Optional and defaults to Case.Sensitive.
cmpRegionStartThe start of the substring within the given string that is to be compared to this. Defaults to 0.
Returns
0 if the contents of the string regions are equal (or if both regions are empty or out of range).
-1 if the instance is less than the given string.
+1 if the instance is greater than the given string or if given string is null.

◆ compareTo() [4/4]

int compareTo ( CharSequence  cmpString,
Case  sensitivity,
int  cmpRegionStart,
int  cmpRegionLength 
)

Compares a given region of a string with this instance. Regions that are out of bounds get adjusted and then compared.

Parameters
cmpStringAn object of type String, StringBuffer or AString that is compared to this.
sensitivityCase sensitivity of the operation. Optional and defaults to Case.Sensitive.
cmpRegionStartThe start of the substring within the given string that is to be compared to this. Defaults to 0.
cmpRegionLengthThe length of the substring within the given string that is to be compared to this. Defaults to Integer.MAX_VALUE.
Returns
0 if the contents of the string regions are equal (or if both regions are empty or out of range).
-1 if the instance is less than the given string.
+1 if the instance is greater than the given string or if given string is null.

◆ consumeBin() [1/2]

boolean consumeBin ( )

Overloaded version of consumeBin(NumberFormat) providing default value null for parameter numberFormat (which selects gloabl object NumberFormat.computational).

Returns
true if an value could be parsed, false otherwise.

◆ consumeBin() [2/2]

boolean consumeBin ( NumberFormat  numberFormat)

Consumes an unsigned 64-bit integer in binary format at the given position from this string. This is done, by invoking NumberFormat.parseBin on the given numberFormat instance.
Parameter numberFormat defaults null. This denotes static singleton NumberFormat.computational which is configured to not using - and therefore also not parsing - grouping characters.

For more information on number conversion, see class NumberFormat.

Note
Although Java does not support unsigned integer, the value that is read with this method is correct in respect to the bits set in the signed value returned. In other words, if the most significant bit (#64), is set, the return value is negative.
Parameters
numberFormatDefines the input format. Optional and defaults to null.
Returns
true if an integer was found, false otherwise.

◆ consumeChar() [1/4]

char consumeChar ( )

Retrieve and remove the first character in the substring.

Returns
The character at the start of the represented region. If this Substring empty or nulled, '\0' is returned.

◆ consumeChar() [2/4]

boolean consumeChar ( char  consumable)

Overloaded version of original method providing default parameter trimBeforeConsume with value Whitespaces.KEEP and default parameter sensitivity with value Case.SENSITIVE.

Parameters
consumableThe consumable character
Returns
true, if this object was starting with consumable and consequently the string was cut by one.

◆ consumeChar() [3/4]

boolean consumeChar ( char  consumable,
Case  sensitivity 
)

Overloaded version of original method providing default parameter trimBeforeConsume with value Whitespaces.KEEP.

Parameters
consumableThe consumable character
sensitivityThe sensitivity of the comparison.
Returns
true, if this object was starting with consumable and consequently the string was cut by one.

◆ consumeChar() [4/4]

boolean consumeChar ( char  consumable,
Case  sensitivity,
Whitespaces  trimBeforeConsume 
)

Checks if this object starts with the given character consumable. If it does, this character is cut from this object.

Parameters
consumableThe consumable character
sensitivityThe sensitivity of the comparison.
trimBeforeConsumeDetermines if the string should be (left-) trimmed before the consume operation. Defaults to Whitespaces.KEEP.
Returns
true, if this object was starting with consumable and consequently the string was cut by one.

◆ consumeCharFromEnd() [1/6]

char consumeCharFromEnd ( )

Retrieve and remove the last character in the substring.

Returns
The character at the start of the represented region. If this Substring empty or nulled, '\0' is returned.

◆ consumeCharFromEnd() [2/6]

boolean consumeCharFromEnd ( char  consumable)

Overloaded version of original method providing default parameter trimBeforeConsume with value Whitespaces.KEEP and default parameter sensitivity with value Case.SENSITIVE.

Parameters
consumableThe consumable character
Returns
true, if this object was starting with consumable and consequently the string was cut by one.

◆ consumeCharFromEnd() [3/6]

boolean consumeCharFromEnd ( char  consumable,
Case  sensitivity 
)

Overloaded version of original method providing default parameter trimBeforeConsume with value Whitespaces.KEEP.

Parameters
consumableThe consumable character
sensitivityThe sensitivity of the comparison.
Returns
true, if this object was starting with consumable and consequently the string was cut by one.

◆ consumeCharFromEnd() [4/6]

boolean consumeCharFromEnd ( char  consumable,
Case  sensitivity,
Whitespaces  trimBeforeConsume 
)

Checks if this object ends with the given character consumable. If it does, this character is cut from the end of object.

Parameters
consumableThe consumable character
sensitivityThe sensitivity of the comparison.
trimBeforeConsumeDetermines if the string should be (right-) trimmed before the consume operation. Defaults to Whitespaces.KEEP.
Returns
true, if this object was starting with consumable and consequently the string was cut by one.

◆ consumeCharFromEnd() [5/6]

int consumeCharFromEnd ( int  regionLength)

Cuts the given number of characters from the end of the Substring.
Parameter regionLength is checked to be between 0 and length. If negative, nothing is cut. If regionLength is greater than this objects' length, all contents is cleared.

Parameters
regionLengthThe length of the region at the start to delete.
Returns
The new length of the substring.

◆ consumeCharFromEnd() [6/6]

int consumeCharFromEnd ( int  regionLength,
Substring  target 
)

Cuts the given number of characters from the end of the Substring and optionally places the portion that was cut in parameter target (if provided).
Parameter regionLength is checked to be between 0 and length. If negative, nothing is cut and target is set empty. If regionLength is greater than this objects' length, all contents is 'moved' to target.

Parameters
regionLengthThe length of the region at the start to delete.
targetAn optional target Substring that receives the portion that is cut from this object. Defaults to null.
Returns
The new length of the substring.

◆ consumeChars() [1/2]

int consumeChars ( int  regionLength)

Cuts the given number of characters from the beginning of the Substring.
Parameter regionLength is checked to be between 0 and length. If negative, nothing is cut. If regionLength is greater than this objects' length, all contents cleared.

Parameters
regionLengthThe length of the region at the start to delete.
Returns
The new length of the substring.

◆ consumeChars() [2/2]

int consumeChars ( int  regionLength,
Substring  target 
)

Cuts the given number of characters from the beginning of the Substring and optionally places the portion that was cut in parameter target (if provided).
Parameter regionLength is checked to be between 0 and length. If negative, nothing is cut and target is set empty. If regionLength is greater than this objects' length, all contents is 'moved' to target.

Parameters
regionLengthThe length of the region at the start to delete.
targetAn optional target Substring that receives the portion that is cut from this object. Defaults to null.
Returns
The new length of the substring.

◆ consumeDec() [1/2]

boolean consumeDec ( )

Overloaded version of consumeDec(NumberFormat) providing default value null for parameter numberFormat (which selects gloabl object NumberFormat.computational).

Returns
true if an value could be parsed, false otherwise.

◆ consumeDec() [2/2]

boolean consumeDec ( NumberFormat  numberFormat)

Consumes an unsigned 64-bit integer in standard decimal format at the given position from the start of this string. This is done, by invoking NumberFormat.parseDec on the given numberFormat instance.
Parameter numberFormat defaults null. This denotes static singleton NumberFormat.computational which is configured to not using - and therefore also not parsing - grouping characters.

Sign literals '-' or '+' are not accepted and parsing will fail. For reading signed integer values, see methods consumeInt, for floating point numbers consumeFloat.

For more information on number conversion, see class NumberFormat.

Note
Because Java does not support unsigned integer, the value to read is limited to Long.MAX_VALUE in this language implementation of ALib.
Parameters
numberFormatDefines the input format. Optional and defaults to null.
Returns
true if an integer was found, false otherwise.

◆ consumeDecDigits()

boolean consumeDecDigits ( )

Consumes all characters '0' to '9' at the start of this object and stores the number value they represent in consumedLong.
Unlike with consumeInt or consumeDec, no sign, whitespaces or group characters are consumed.

Returns
true if an integer was found, false otherwise.

◆ consumeField() [1/2]

Substring consumeField ( char  startChar,
char  endChar,
Substring  target 
)

Overloaded version of original method providing default parameter trimBeforeConsume with value Whitespaces.KEEP.

Parameters
startCharThe start character of the field to consume.
endCharThe end character of the field to consume.
targetThe target string to place the field in.
Returns
The string consumed. NullString on error (start/end character not found)

◆ consumeField() [2/2]

Substring consumeField ( char  startChar,
char  endChar,
Substring  target,
Whitespaces  trimBeforeConsume 
)

Consumes a field from the beginning of this substring, which is surrounded by given start end end character identifiers. If both are the same, e.g. '"', then the first occurrence of the end character is used. If they are not the same, e.g. '<' and '>', then repeated start characters are counted and consumption only ends when a corresponding amount of end characters has been found.

Parameters
startCharThe start character of the field to consume.
endCharThe end character of the field to consume.
targetThe target string to place the field in.
trimBeforeConsumeDetermines if the string should be (left-) trimmed before the consume operation. Defaults to Whitespaces.Keep.
Returns
The string consumed. NullString on error (start/end character not found)

◆ consumeFloat() [1/2]

boolean consumeFloat ( )

Overloaded version of consumeFloat(NumberFormat) providing default value null for parameter numberFormat (which selects gloabl object NumberFormat.computational).

Returns
true if an value could be parsed, false otherwise.

◆ consumeFloat() [2/2]

boolean consumeFloat ( NumberFormat  numberFormat)

Consumes a floating point number at the given position from this AString. This is done, by invoking NumberFormat.parseFloat on the given numberFormat instance.
Parameter numberFormat defaults null. This denotes static singleton NumberFormat.computational which is configured to 'international' settings (not using the locale) and therefore also not parsing - grouping characters.

For more information on parsing options for floating point numbers and number conversion in general, see class NumberFormat.

Parameters
numberFormatDefines the input format. Optional and defaults to null.
Returns
true if a number was found and, false otherwise.

◆ consumeHex() [1/2]

boolean consumeHex ( )

Overloaded version of consumeHex(NumberFormat) providing default value null for parameter numberFormat (which selects gloabl object NumberFormat.computational).

Returns
true if an value could be parsed, false otherwise.

◆ consumeHex() [2/2]

boolean consumeHex ( NumberFormat  numberFormat)

Reads an unsigned 64-bit integer in hexadecimal format at the given position from this AString. This is done, by invoking NumberFormat.parseHex on the given numberFormat instance.
Parameter numberFormat defaults null. This denotes static singleton NumberFormat.computational which is configured to not using - and therefore also not parsing - grouping characters.

For more information on number conversion, see class NumberFormat.

Note
Although Java does not support unsigned integer, the value that is read with this method is correct in respect to the bits set in the signed value returned. In other words, if the most significant bit (#64), is set, the return value is negative. For this, 16 hexadecimal digits need to be read and the first of them needs to be greater or equal to 0x8.
Parameters
numberFormatDefines the input format. Optional and defaults to null.
Returns
true if an integer was found, false otherwise.

◆ consumeInt() [1/2]

boolean consumeInt ( )

Overloaded version of consumeInt(NumberFormat) providing default value null for parameter numberFormat (which selects gloabl object NumberFormat.computational).

Returns
true if an value could be parsed, false otherwise.

◆ consumeInt() [2/2]

boolean consumeInt ( NumberFormat  numberFormat)

Consumes a long integer value in decimal, binary, hexadecimal or octal format from the start of the string by invoking method NumberFormat.parseInt on the given numberFormat instance.
Parameter numberFormat defaults null. This denotes static singleton NumberFormat.computational which is configured to 'international' settings (not using the locale) and therefore also not parsing grouping characters.

Parameters
numberFormatDefines the input format. Optional and defaults to null.
Returns
true if an integer was found, false otherwise.

◆ consumeOct() [1/2]

boolean consumeOct ( )

Overloaded version of consumeOct(NumberFormat) providing default value null for parameter numberFormat (which selects gloabl object NumberFormat.computational).

Returns
true if an value could be parsed, false otherwise.

◆ consumeOct() [2/2]

boolean consumeOct ( NumberFormat  numberFormat)

Consumes an unsigned 64-bit integer in octal format at the given position from this string. This is done, by invoking NumberFormat.parseOct on the given numberFormat instance.
Parameter numberFormat defaults null. This denotes static singleton NumberFormat.computational which is configured to not using - and therefore also not parsing - grouping characters.

For more information on number conversion, see class NumberFormat.

Note
Although Java does not support unsigned integer, the value that is read with this method is correct in respect to the bits set in the signed value returned. In other words, if the most significant bit (#64), is set, the return value is negative. For this, 22 octal digits need to be read with the first being 1.
Parameters
numberFormatDefines the input format. Optional and defaults to null.
Returns
true if an integer was found, false otherwise.

◆ consumePartOf() [1/4]

int consumePartOf ( String  consumable)

Overloaded version of original method providing default parameter trimBeforeConsume with value Whitespaces.KEEP, sensitivity with value Case.Sensitive and minChars with value 1.

Parameters
consumableThe consumable string.
Returns
The amount of characters consumed.

◆ consumePartOf() [2/4]

int consumePartOf ( String  consumable,
int  minChars 
)

Overloaded version of original method providing default parameter trimBeforeConsume with value Whitespaces.KEEP and sensitivity with value Case.Sensitive.

Parameters
consumableThe consumable string.
minCharsThe minimum amount of characters to consume. Optional and defaults to 1
Returns
The amount of characters consumed.

◆ consumePartOf() [3/4]

int consumePartOf ( String  consumable,
int  minChars,
Case  sensitivity 
)

Overloaded version of original method providing default parameter trimBeforeConsume with value Whitespaces.KEEP.

Parameters
consumableThe consumable string.
minCharsThe minimum amount of characters to consume. Optional and defaults to 1
sensitivityThe sensitivity of the comparison.
Returns
The amount of characters consumed.

◆ consumePartOf() [4/4]

int consumePartOf ( String  consumable,
int  minChars,
Case  sensitivity,
Whitespaces  trimBeforeConsume 
)

Consumes a minimum of minChars of string consumable from the start of this substring. If the minimum characters could not be found, nothing is consumed, otherwise as much as possible.
This method is useful for example to read commands from a string that may be abbreviated.

Parameters
consumableThe consumable string.
minCharsThe minimum amount of characters to consume. If 0 or negative, the length of consumable is chosen. Optional and defaults to 1.
sensitivityThe sensitivity of the comparison. Defaults to Case.Ignore.
trimBeforeConsumeDetermines if the string should be (left-) trimmed before the first character consume operation. Defaults to Whitespaces.KEEP.
Returns
The amount of characters consumed.

◆ consumeString() [1/3]

boolean consumeString ( CharSequence  consumable)

Overloaded version of original method providing default parameter trimBeforeConsume with value Whitespaces.KEEP and default parameter sensitivity with value Case.SENSITIVE.

Parameters
consumableThe consumable string
Returns
true, if this object was starting with consumable and consequently the string was cut.

◆ consumeString() [2/3]

boolean consumeString ( CharSequence  consumable,
Case  sensitivity 
)

Overloaded version of original method providing default parameter trimBeforeConsume with value Whitespaces.KEEP.

Parameters
consumableThe consumable string
sensitivityThe sensitivity of the comparison.
Returns
true, if this object was starting with consumable and consequently the string was cut.

◆ consumeString() [3/3]

boolean consumeString ( CharSequence  consumable,
Case  sensitivity,
Whitespaces  trimBeforeConsume 
)

Checks if this object starts with the given string consumable. If it does, this string is cut from this object.

Parameters
consumableThe consumable string
sensitivityThe sensitivity of the comparison.
trimBeforeConsumeDetermines if the string should be (left-) trimmed before the consume operation. Defaults to Whitespaces.KEEP.
Returns
true, if this object was starting with consumable and consequently the string was cut.

◆ consumeStringFromEnd() [1/3]

boolean consumeStringFromEnd ( CharSequence  consumable)

Overloaded version of original method providing default parameter trimBeforeConsume with value Whitespaces.KEEP and default parameter sensitivity with value Case.SENSITIVE.

Parameters
consumableThe consumable string
Returns
true, if this object was starting with consumable and consequently the string was cut.

◆ consumeStringFromEnd() [2/3]

boolean consumeStringFromEnd ( CharSequence  consumable,
Case  sensitivity 
)

Overloaded version of original method providing default parameter trimBeforeConsume with value Whitespaces.KEEP.

Parameters
consumableThe consumable string
sensitivityThe sensitivity of the comparison.
Returns
true, if this object was starting with consumable and consequently the string was cut.

◆ consumeStringFromEnd() [3/3]

boolean consumeStringFromEnd ( CharSequence  consumable,
Case  sensitivity,
Whitespaces  trimBeforeConsume 
)

Checks if this object ends with the given string consumable. If it does, this string is cut from the end of object.

Parameters
consumableThe consumable string
sensitivityThe sensitivity of the comparison.
trimBeforeConsumeDetermines if the string should be (right-) trimmed before the consume operation. Defaults to Whitespaces.KEEP.
Returns
true, if this object was starting with consumable and consequently the string was cut.

◆ consumeToken()

int consumeToken ( Substring  target,
char  separator 
)

Searches separator and cuts the beginning of this string, including the separator. What was consumed is returned, excluding the separator.

If the separator is not found, all of this string is consumed and returned.

Parameters
targetThe target substring.
separatorThe separator to search. Defaults to ','.
Returns
The number of characters consumed.

◆ containsAt() [1/6]

boolean containsAt ( AString  needle,
int  pos 
)

Checks if a String is located at the given position.

Parameters
needleThe CharSequence to search.
posThe position within this object to look at.
Returns
True if given sequence is found at the given position. False otherwise .

◆ containsAt() [2/6]

boolean containsAt ( AString  needle,
int  pos,
Case  sensitivity 
)

Checks if an AString is located at the given position.

Parameters
needleThe AString to search.
posThe position within this object to look at.
sensitivityCase sensitivity of the operation. Optional and defaults to Case.Sensitive.
Returns
True if the sequence is found at the given position. False otherwise .

◆ containsAt() [3/6]

boolean containsAt ( CharSequence  needle,
int  pos 
)

Checks if a CharSequence is located at the given position.

Parameters
needleThe CharSequence to search.
posThe position within this object to look at.
Returns
True if the sequence is found at the given position. False otherwise .

◆ containsAt() [4/6]

boolean containsAt ( CharSequence  needle,
int  pos,
Case  sensitivity 
)

Checks if a CharSequence is located at the given position.

Parameters
needleThe CharSequence to search.
posThe position within this object to look at.
sensitivityCase sensitivity of the operation. Optional and defaults to Case.Sensitive.
Returns
True if the sequence is found at the given position. False otherwise .

◆ containsAt() [5/6]

boolean containsAt ( Substring  needle,
int  pos 
)

Checks if a Substring is located at the given position.

Parameters
needleThe CharSequence to search.
posThe position within this object to look at.
Returns
True if the sequence is found at the given position. False otherwise .

◆ containsAt() [6/6]

boolean containsAt ( Substring  needle,
int  pos,
Case  sensitivity 
)

Checks if a Substring is located at the given position.

Parameters
needleThe Substring to search.
posThe position within this object to look at.
sensitivityCase sensitivity of the operation. Optional and defaults to Case.Sensitive.
Returns
True if the sequence is found at the given position. False otherwise .

◆ copyTo() [1/2]

void copyTo ( AString  target)

Copies the string region represented by this object into the given AString. The AString will be cleared before copying.

Parameters
targetThe target AString to copy the region this object represents to.

◆ copyTo() [2/2]

void copyTo ( AString  target,
boolean  append 
)

Copies the string region represented by this object into the given AString

Parameters
targetThe target AString to copy the region this object represents to.
appendIf true, the target AString is not cleared. Defaults to false.

◆ endsWith() [1/6]

boolean endsWith ( AString  needle)

Checks if this Substring ends with the given sequence.

Parameters
needleThe AString to search. If s is null or empty, false is returned.
Returns
true if this starts with the given sequence, false if not.

◆ endsWith() [2/6]

boolean endsWith ( AString  needle,
Case  sensitivity 
)

Checks if this Substring ends with the given sequence.

Parameters
needleThe AString to search. If s is null or empty, false is returned.
sensitivityCase sensitivity of the operation. Optional and defaults to Case.Sensitive.
Returns
true if this starts with the given sequence, false if not.

◆ endsWith() [3/6]

boolean endsWith ( CharSequence  needle)

Checks if this Substring ends with the given sequence.

Parameters
needleThe CharSequence to search. If s is null or empty, false is returned.
Returns
true if this starts with the given sequence, false if not.

◆ endsWith() [4/6]

boolean endsWith ( CharSequence  needle,
Case  sensitivity 
)

Checks if this Substring ends with the given sequence.

Parameters
needleThe CharSequence to search. If s is null or empty, false is returned.
sensitivityCase sensitivity of the operation. Optional and defaults to Case.Sensitive.
Returns
true if this starts with the given sequence, false if not.

◆ endsWith() [5/6]

boolean endsWith ( Substring  needle)

Checks if this Substring ends with the given sequence.

Parameters
needleThe Substring to search. If s is null or empty, false is returned.
Returns
true if this starts with the given sequence, false if not.

◆ endsWith() [6/6]

boolean endsWith ( Substring  needle,
Case  sensitivity 
)

Checks if this Substring ends with the given sequence.

Parameters
needleThe Substring to search. If s is null or empty, false is returned.
sensitivityCase sensitivity of the operation. Optional and defaults to Case.Sensitive.
Returns
true if this starts with the given sequence, false if not.

◆ equals() [1/10]

boolean equals ( AString  cmpString)

Tests and returns true, if the given AString equals to what this object represents. True is returned if both are zero length or null.

Parameters
cmpStringThe AString that is compared to this AString.
Returns
true, if contents of this and the given AString are equal

◆ equals() [2/10]

boolean equals ( AString  cmpString,
Case  sensitivity 
)

Tests and returns true, if the given AString equals to what this object represents. True is returned if both are zero length or null.

Parameters
cmpStringThe AString that is compared to this AString.
sensitivityCase sensitivity of the comparison. Optional and defaults to Case.Sensitive.
Returns
true, if contents of this and the given AString are equal

◆ equals() [3/10]

boolean equals ( CharSequence  cmpString)

Tests and returns true, if the given CharSequence equals to what this object represents. True is returned if both are zero length or null.

Parameters
cmpStringA CharSequence that is compared to this AString.
Returns
true, if contents of this and the given AString are equal

◆ equals() [4/10]

boolean equals ( CharSequence  cmpString,
Case  sensitivity 
)

Tests and returns true, if the given CharSequence equals to what this object represents. True is returned if both are zero length or null.

Parameters
cmpStringA CharSequence that is compared to this AString.
sensitivityCase sensitivity of the comparison. Optional and defaults to Case.Sensitive.
Returns
true, if contents of this and the given AString are equal

◆ equals() [5/10]

boolean equals ( Object  object)

Compares this to the given object. .

Parameters
objectThe object to compare to this instance.
Returns
True if given object equals this.

◆ equals() [6/10]

boolean equals ( Object  object,
Case  sensitivity 
)

Compares this to the given object. Given object can be of type

  • AString
  • Substring
  • String or
  • CharSequence
Parameters
objectThe object to compare to this instance.
sensitivityCase sensitivity of the comparison. Optional and defaults to Case.Sensitive.
Returns
True if given object equals this.

◆ equals() [7/10]

boolean equals ( String  cmpString)

Tests and returns true, if the given String equals to what this object represents. True is returned if both are zero length or null.

Parameters
cmpStringThe AString that is compared to this AString.
Returns
true, if contents of this and the given AString are equal

◆ equals() [8/10]

boolean equals ( String  cmpString,
Case  sensitivity 
)

Tests and returns true, if the given String equals to what this object represents. True is returned if both are zero length or null.

Parameters
cmpStringThe AString that is compared to this AString.
sensitivityCase sensitivity of the comparison. Optional and defaults to Case.Sensitive.
Returns
true, if contents of this and the given AString are equal

◆ equals() [9/10]

boolean equals ( Substring  cmpString)

Tests and returns true, if the given other Substring equals to what this object represents. True is returned if both are zero length or null.

Parameters
cmpStringA Substring that is compared to this AString.
Returns
true, if contents of this and the given AString are equal

◆ equals() [10/10]

boolean equals ( Substring  cmpString,
Case  sensitivity 
)

Tests and returns true, if the given other Substring equals to what this object represents. True is returned if both are zero length or null.

Parameters
cmpStringA Substring that is compared to this AString.
sensitivityCase sensitivity of the comparison. Optional and defaults to Case.Sensitive.
Returns
true, if contents of this and the given AString are equal

◆ hashCode()

int hashCode ( )

Standard Java Object hashCode method.

Returns
Result of parents' hashCode.

◆ indexOf() [1/5]

int indexOf ( char  c)

Searches the given character.

Parameters
cThe character to search.
Returns
The index of the character within this substring, -1 if the character is not found.

◆ indexOf() [2/5]

int indexOf ( char  needle,
int  startIdx 
)

Search a character in the buffer.

Parameters
needleThe character to search.
startIdxThe index to start the search at. Optional and defaults to 0.
Returns
-1 if the character is not found. Otherwise the index of first occurrence.

◆ indexOf() [3/5]

int indexOf ( CharSequence  cs)

Search a CharSequence in the buffer.

Parameters
csThe CharSequence to search.
Returns
-1 if the String is not found. Otherwise the index of first occurrence.

◆ indexOf() [4/5]

int indexOf ( CharSequence  cs,
int  startIdx 
)

Search a CharSequence in the buffer.

Parameters
csThe CharSequence to search.
startIdxThe index to start the search at. Optional and defaults to 0.
Returns
-1 if the String is not found. Otherwise the index of first occurrence.

◆ indexOf() [5/5]

int indexOf ( CharSequence  needle,
int  startIdx,
Case  sensitivity 
)

Search the given String in the buffer starting at a given position.

Parameters
needleThe CharSequence to search.
startIdxThe index to start the search at. Optional and defaults to 0.
sensitivityCase sensitivity of the operation. Optional and defaults to Case.Sensitive.
Returns
-1 if the String is not found. Otherwise the index of first occurrence.

◆ indexOfAny() [1/2]

int indexOfAny ( char[]  needles,
Inclusion  inclusion 
)

Returns the index of the first character which is included, respectively not included in a given set of characters.

This method searches from left to right. For reverse search, see lastIndexOfAny.

Parameters
needlesCharacters to be searched for.
inclusionDenotes whether the search returns the first index that holds a value that is included or that is not excluded in the set of needle characters.
Returns
The index of the first character found which is included, respectively not included, in the given set of characters. If nothing is found, -1 is returned.

◆ indexOfAny() [2/2]

int indexOfAny ( char[]  needles,
Inclusion  inclusion,
int  startIdx 
)

Returns the index of the first character which is included, respectively not included in a given set of characters.

This method searches from left to right. For reverse search, see lastIndexOfAny.

Parameters
needlesCharacters to be searched for.
inclusionDenotes whether the search returns the first index that holds a value that is included or that is not excluded in the set of needle characters.
startIdxThe index to start the search at. If the given value is less than 0, it is set to 0. If it exceeds the length of the string, the length of the string is returned. Defaults to 0.
Returns
The index of the first character found which is included, respectively not included, in the given set of characters. If nothing is found, -1 is returned.

◆ indexOfFirstDifference() [1/3]

int indexOfFirstDifference ( CharSequence  needle)

Overloaded version providing default paramter startIdx with value 0 and sensitivity with value Case.SENSITIVE.

Parameters
needleThe String to search.
Returns
-1 if the String is not found. Otherwise the index of first occurrence.

◆ indexOfFirstDifference() [2/3]

int indexOfFirstDifference ( CharSequence  needle,
Case  sensitivity 
)

Overloaded version providing default paramter startIdx with value 0.

Parameters
needleThe String to search.
sensitivityCase sensitivity of the comparison. Optional and defaults to Case.SENSITIVE.
Returns
-1 if the String is not found. Otherwise the index of first occurrence.

◆ indexOfFirstDifference() [3/3]

int indexOfFirstDifference ( CharSequence  needle,
Case  sensitivity,
int  startIdx 
)

Searches the first difference with given string. If this string starts with needle, then the length of needle is returned.

Parameters
needleThe String to search.
sensitivityCase sensitivity of the comparison. Optional and defaults to Case.SENSITIVE.
startIdxThe index to start the search at. Optional and defaults to 0.
Returns
The index of the first difference found in needle or the neele's length.

◆ indexOfOrLength() [1/2]

int indexOfOrLength ( char  needle)

Like indexOf but in case the character is not found, this method returns the length of this string instead of -1. Depending on the invocation context, the choice for the right version of this method may lead to shorter and more efficient code.

Parameters
needleThe character to search for.
Returns
This strings length if the character needle is not found. Otherwise the index of first occurrence.

◆ indexOfOrLength() [2/2]

int indexOfOrLength ( char  needle,
int  startIdx 
)

Like indexOf but in case the character is not found, this method returns the length of this string instead of -1. Depending on the invocation context, the choice for the right version of this method may lead to shorter and more efficient code.

Parameters
needleThe character to search for.
startIdxThe index in this to start searching the character.
Returns
This strings length if the character needle is not found. Otherwise the index of first occurrence.

◆ isEmpty()

boolean isEmpty ( )

Checks if represented region has a length of zero.

Returns
true if the represented region is empty.

◆ isNotEmpty()

boolean isNotEmpty ( )

Checks if the represented region has a length of more than zero.

Returns
true if the length of the substring represented does not equal zero.

◆ isNotNull()

boolean isNotNull ( )

Returns
true if this does not represent a null string

◆ isNull()

boolean isNull ( )

Returns
true if this represents a null string

◆ lastIndexOfAny() [1/2]

int lastIndexOfAny ( char[]  needles,
Inclusion  inclusion 
)

Returns the index of the first character which is included, respectively not included in a given set of characters. The search starts at the end and goes backward. For forward search, see indexOfAny.

Parameters
needlesCharacters to be searched for.
inclusionDenotes whether the search returns the first index that holds a value that is included or that is not excluded in the set of needle characters.
Returns
The index of the first character found which is included, respectively not included, in the given set of characters. If nothing is found, -1 is returned.

◆ lastIndexOfAny() [2/2]

int lastIndexOfAny ( char[]  needles,
Inclusion  inclusion,
int  startIdx 
)

Returns the index of the first character which is included, respectively not included in a given set of characters. The search starts at the given index and goes backward. For forward search, see indexOfAny.

Parameters
needlesCharacters to be searched for.
inclusionDenotes whether the search returns the first index that holds a value that is included or that is not excluded in the set of needle characters.
startIdxThe index to start the search at. The value is cropped to be in the bounds of 0 and the length of this object minus one. Defaults to the length of this object.
Returns
The index of the first character found which is included, respectively not included, in the given set of characters. If nothing is found, -1 is returned.

◆ length()

int length ( )

Returns
The length of the represented region.

◆ set() [1/12]

Substring set ( AString  src)

Resets the sub-string to work on the provided AString.

Parameters
srcThe string to work on.
Returns
this to allow concatenated calls.

◆ set() [2/12]

Substring set ( AString  src,
int  regionStart 
)

Resets the sub-string to work on the provided AString.

Parameters
srcThe string to work on.
regionStartThe start of the region within src. Defaults to 0.
Returns
this to allow concatenated calls.

◆ set() [3/12]

Substring set ( AString  src,
int  regionStart,
int  regionLength 
)

Resets the sub-string to work on the provided AString.

Parameters
srcThe string to work on.
regionStartThe start of the region within src. Defaults to 0.
regionLengthThe length of the region within src. Defaults to the length of src.
Returns
this to allow concatenated calls.

◆ set() [4/12]

Substring set ( char[]  src)

Resets the sub-string to work on the provided character array.

Parameters
srcThe string to work on.
Returns
this to allow concatenated calls.

◆ set() [5/12]

Substring set ( char[]  src,
int  regionStart 
)

Resets the sub-string to work on the provided character array.

Parameters
srcThe string to work on.
regionStartThe start of the region within src. Defaults to 0.
Returns
this to allow concatenated calls.

◆ set() [6/12]

Substring set ( char[]  src,
int  regionStart,
int  regionLength 
)

Resets the sub-string to work on the provided character array.

Parameters
srcThe string to work on.
regionStartThe start of the region within src. Defaults to 0.
regionLengthThe length of the region within src. Defaults to the length of src.
Returns
this to allow concatenated calls.

◆ set() [7/12]

Substring set ( String  src)

Resets the sub-string to work on the provided String

Parameters
srcThe string to work on.
Returns
this to allow concatenated calls.

◆ set() [8/12]

Substring set ( String  src,
int  regionStart 
)

Resets the sub-string to work on the provided String

Parameters
srcThe string to work on.
regionStartThe start of the region within src. Defaults to 0.
Returns
this to allow concatenated calls.

◆ set() [9/12]

Substring set ( String  src,
int  regionStart,
int  regionLength 
)

Resets the sub-string to work on the provided String

Parameters
srcThe string to work on.
regionStartThe start of the region within src. Defaults to 0.
regionLengthThe length of the region within src. Defaults to the length of src.
Returns
this to allow concatenated calls.

◆ set() [10/12]

Substring set ( Substring  src)

Sets the substring to be identical to the given substring.

Parameters
srcThe string to work on.
Returns
this to allow concatenated calls.

◆ set() [11/12]

Substring set ( Substring  src,
int  regionStart 
)

Sets the substring to represent a region of the given Substring.

Parameters
srcThe string to work on.
regionStartThe start of the region within src. Defaults to 0.
Returns
this to allow concatenated calls.

◆ set() [12/12]

Substring set ( Substring  src,
int  regionStart,
int  regionLength 
)

Sets the substring to represent a region of the given Substring.

Parameters
srcThe string to work on.
regionStartThe start of the region within src. Defaults to 0.
regionLengthThe length of the region within src. If negative, length of the provided src is used. Defaults to -1.
Returns
this to allow concatenated calls.

◆ setNull()

void setNull ( )

Sets this to null state and in addition to empty state.

◆ split()

Substring split ( int  position,
Substring  target,
int  separatorWidth 
)

Splits this substring into two parts. What remains in this object is the region from 0 to position. target receives the rest. If optional parameter separatorWidth is given, this is subtracted from the front of target.

Parameters
positionThe index where this object is split.
targetThe target substring to receive the right part of the string.
separatorWidthThis does not change what remains in this object, but defines the number of characters that are cut from the front of the target. Defaults to 0.
Returns
this to allow concatenated calls.

◆ startsWith() [1/6]

boolean startsWith ( AString  needle)

Checks if this Substring starts with the given sequence.

Parameters
needleThe AString to search. If s is null or empty, false is returned.
Returns
true if this starts with the given sequence, false if not.

◆ startsWith() [2/6]

boolean startsWith ( AString  needle,
Case  sensitivity 
)

Checks if this Substring starts with the given sequence.

Parameters
needleThe AString to search. If s is null or empty, false is returned.
sensitivityCase sensitivity of the operation. Optional and defaults to Case.Sensitive.
Returns
true if this starts with the given sequence, false if not.

◆ startsWith() [3/6]

boolean startsWith ( CharSequence  needle)

Checks if this Substring starts with the given sequence.

Parameters
needleThe CharSequence to search. If s is null or empty, false is returned.
Returns
true if this starts with the given sequence, false if not.

◆ startsWith() [4/6]

boolean startsWith ( CharSequence  needle,
Case  sensitivity 
)

Checks if this Substring starts with the given sequence.

Parameters
needleThe CharSequence to search. If s is null or empty, false is returned.
sensitivityCase sensitivity of the operation. Optional and defaults to Case.Sensitive.
Returns
true if this starts with the given sequence, false if not.

◆ startsWith() [5/6]

boolean startsWith ( Substring  needle)

Checks if this Substring starts with the given sequence.

Parameters
needleThe Substring to search. If s is null or empty, false is returned.
Returns
true if this starts with the given sequence, false if not.

◆ startsWith() [6/6]

boolean startsWith ( Substring  needle,
Case  sensitivity 
)

Checks if this Substring starts with the given sequence.

Parameters
needleThe Substring to search. If s is null or empty, false is returned.
sensitivityCase sensitivity of the operation. Optional and defaults to Case.Sensitive.
Returns
true if this starts with the given sequence, false if not.

◆ subSequence()

CharSequence subSequence ( int  beginIndex,
int  endIndex 
)

Reports an ALib error (using ReportWriter) and returns null. The reason for this behavior is to disallow the usage of AString within (system) methods that create sub sequences. This would be in contrast to the design goal of AString.

Parameters
beginIndexThe start of the sequence (not used)
endIndexThe length of the sequence (not used)
Returns
null (!).

◆ toString() [1/3]

String toString ( )

Overrides Object.ToString(). Copies the string region represented by this object into a new string.

Returns
A String with the contents of this sub-string.

◆ toString() [2/3]

String toString ( int  regionStart)

Overloaded version providing default parameter regionLength as Integer.MAX_VALUE.

Parameters
regionStartThe start index of the region in this to create the string from.
Returns
A String that represents the specified sub region of this object.

◆ toString() [3/3]

String toString ( int  regionStart,
int  regionLength 
)

Creates a String containing a copy of a region of the this Substring.

Parameters
regionStartThe start index of the region in this to create the string from.
regionLengthThe maximum length of the region to create the string from. Defaults to Integer.MAX_VALUE.
Returns
A String that represents the specified sub region of this object.

◆ trim() [1/2]

Substring trim ( )

Invokes trim(char[] whiteSpaces) providing default parameter CString.DEFAULT_WHITESPACES.

Returns
this to allow concatenated calls.

◆ trim() [2/2]

Substring trim ( char[]  whiteSpaces)

Invokes trimStart and trimEnd.

Parameters
whiteSpacesThe characters used for trimming. Defaults to CString.DEFAULT_WHITESPACES.
Returns
this to allow concatenated calls.

◆ trimEnd() [1/2]

Substring trimEnd ( )

Invokes trimEnd(char[] whiteSpaces) providing default parameter CString.DEFAULT_WHITESPACES.

Returns
this to allow concatenated calls.

◆ trimEnd() [2/2]

Substring trimEnd ( char[]  whiteSpaces)

Moves the start marker to the first character not found in parameter whiteSpaces.

Parameters
whiteSpacesThe characters used for trimming. Defaults to CString.DEFAULT_WHITESPACES.
Returns
this to allow concatenated calls.

◆ trimStart() [1/2]

Substring trimStart ( )

Invokes trimStart(char[] whiteSpaces) providing default parameter CString.DEFAULT_WHITESPACES.

Returns
this to allow concatenated calls.

◆ trimStart() [2/2]

Substring trimStart ( char[]  whiteSpaces)

Moves the start marker to the first character not found in parameter whiteSpaces.

Parameters
whiteSpacesThe characters used for trimming. Defaults to CString.DEFAULT_WHITESPACES.
Returns
this to allow concatenated calls.

Member Data Documentation

◆ _adjustedRegion

int [] _adjustedRegion = new int[2]
protected

Used as a return value of method CString.adjustRegion

◆ buf

char [] buf

The character array we work on.

◆ consumedFloat

double consumedFloat

Used as second return value with method consumeFloat.

◆ consumedLong

long consumedLong

Used as second return value with method various consumeChar methods.

◆ end

int end

End marker within buf (points to the last character)

◆ start

int start

Start marker within buf


The documentation for this class was generated from the following file: