org.das2.jythoncompletion.nbadapt.CharSequenceUtilities

Utility methods related to character sequences.


checkIndexNonNegative

checkIndexNonNegative( int index ) → void

Ensure that the given index is >=0 and lower than the given length.

Returns:

void (returns nothing)

search for examples view on GitHub view source


checkIndexValid

checkIndexValid( int index, int length ) → void

Ensure that the given index is >=0 and lower than the given length.

Returns:

void (returns nothing)

search for examples view on GitHub view source


checkIndexesValid

checkIndexesValid( java.lang.CharSequence text, int start, int end ) → void

Ensure that the given start and end parameters are valid indices of the given text.

Returns:

void (returns nothing)

search for examples view on GitHub view source


debugChar

debugChar( java.lang.StringBuffer sb, char ch ) → void

Append the character description to the given string buffer translating the special characters (and '\') into escape sequences.

Parameters

sb - non-null string buffer to append to.
ch - character to be debugged.

Returns:

void (returns nothing)

search for examples view on GitHub view source


debugText

debugText( java.lang.StringBuffer sb, java.lang.CharSequence text ) → void

Append the text description to the given string buffer translating the special characters (and '\') into escape sequences.

Parameters

sb - non-null string buffer to append to.
text - non-null text to be debugged.

Returns:

void (returns nothing)

search for examples view on GitHub view source


endsWith

endsWith( java.lang.CharSequence text, java.lang.CharSequence suffix ) → boolean

Implementation of {@link String#endsWith(String)} for character sequences.

Returns:

boolean

search for examples view on GitHub view source


lastIndexOf

lastIndexOf( java.lang.CharSequence text, java.lang.CharSequence seq ) → int

Implementation of {@link String#lastIndexOf(String)} for character sequences.

Returns:

int

search for examples view on GitHub view source


startsWith

startsWith( java.lang.CharSequence text, java.lang.CharSequence prefix ) → boolean

Implementation of {@link String#startsWith(String)} for character sequences.

Returns:

boolean

search for examples view on GitHub view source


stringLikeHashCode

stringLikeHashCode( java.lang.CharSequence text ) → int

Compute {@link String}-like hashcode over given {@link CharSequence}.

Parameters

text - character sequence for which the hashcode is being computed.

Returns:

hashcode of the given character sequence.

search for examples view on GitHub view source


textEquals

textEquals( java.lang.CharSequence text1, java.lang.CharSequence text2 ) → boolean

Test whether whether the given character sequences represent the same text.
The match is successful if the contained characters of the two character sequences are the same.

Parameters

text1 - first character sequence being compared. It must not be null.
text2 - second character sequence being compared. It must not be null.

Returns:

true if both parameters are equal in String-like manner.

search for examples view on GitHub view source