Drag[en]gine Script Module DragonScript 1.35
Loading...
Searching...
No Matches
Dragengine.UnicodeString Class Reference

Unicode string. More...

Inheritance diagram for Dragengine.UnicodeString:

Public Member Functions

Management
int getLength ()
 Count of characters in the unicode string.
int getCharacterAt (int position)
 Unicode character at the given location.
UnicodeString getLeft (int count)
 Unicode string with characters from beginning.
UnicodeString getRight (int count)
 Unicode string with characters from the end.
UnicodeString getSubString (int position, int count)
 Unicode string with characters from middle.
UnicodeString reverse ()
 Unicode string with the reversed order of characters.
Trim
UnicodeString trimLeft ()
 Unicode string with white spaces stripped from beginning.
UnicodeString trimRight ()
 Unicode string with white spaces stripped from the end.
UnicodeString trimBoth ()
 Unicode string with white spaces stripped from beginning and end.
Search
int findCharacter (int character, int position)
 Index of first occurance of character.
int findCharacterReverse (int character, int position)
 Index of first occurance of character from end to start.
Compare
int compareTo (UnicodeString string)
 Compare cases sensitive to another unicode string.
int compareToNoCase (UnicodeString string)
 Compare cases insensitive to another unicode string.
String toString ()
 UTF8 encoded string.
bool equals (Object other)
 Unicode string is equal to another object.
int hashCode ()
 Hash code for use as dictionary keys.
int compare (Object obj)
 Compare object with another object.
Convert
UnicodeString toLower ()
 Unicode string with all characters converted to lower case.
UnicodeString toUpper ()
 Unicode string with all characters converted to upper case.
int toInt ()
 Converted to integer if possible.
float toFloat ()
 Converted to floating point value if possible.
String toUTF8 ()
 UTF8 encoding of the unicode string.
Operators
UnicodeString operator+ (UnicodeString string)
 Concatenation of two unicode strings.
UnicodeString operator+ (byte value)
 Concatenation of unicode string and character.
UnicodeString operator+ (bool value)
 Concatenation of unicode string and boolean value converted to string.
UnicodeString operator+ (int value)
 Concatenation of unicode string and integer value converted to string.
UnicodeString operator+ (float value)
 Concatenation of unicode string and floating point value converted to string.
UnicodeString operator+ (Object object)
 Concatenation of unicode string and object value converted to string using Object.toString().

Constructors

UnicodeString new ()
 Create empty unicode string.
UnicodeString new (UnicodeString string)
 Create copy of unicode string.
UnicodeString new (int character)
 Create unicode string from unicode character.
static UnicodeString newFromUTF8 (String string)
 Create unicode string from utf8 encoded string.

Detailed Description

Unicode string.

This is a native class.

Member Function Documentation

◆ compare()

int Dragengine.UnicodeString.compare ( Object obj)

Compare object with another object.

Used to sort objects. Overwrite to implement sorting.

Return values
0Object is equal to obj.
<0Object comes before obj.
>0Object comes after obj.

References compareToNoCase().

Referenced by operator+().

◆ compareTo()

int Dragengine.UnicodeString.compareTo ( UnicodeString string)

Compare cases sensitive to another unicode string.

Return values
0Strings are equal.
<0First differing character has smaller lexicographical value.
>0First differing character has larger lexicographical value.

References findCharacter().

Referenced by hashCode().

◆ compareToNoCase()

int Dragengine.UnicodeString.compareToNoCase ( UnicodeString string)

Compare cases insensitive to another unicode string.

Return values
0Strings are equal.
<0First differing character has smaller lexicographical value.
>0First differing character has larger lexicographical value.

References findCharacterReverse().

Referenced by compare().

◆ equals()

bool Dragengine.UnicodeString.equals ( Object other)

Unicode string is equal to another object.

Implements Object.equals(Object).

Returns
true if other is of type UnicodeString and both are equal.

Referenced by toFloat().

◆ findCharacter()

int Dragengine.UnicodeString.findCharacter ( int character,
int position )

Index of first occurance of character.

Exceptions
EOutOfBoundaryposition is less than 0 or greater than or equal to getLength().

References trimLeft(), and trimRight().

Referenced by compareTo().

◆ findCharacterReverse()

int Dragengine.UnicodeString.findCharacterReverse ( int character,
int position )

Index of first occurance of character from end to start.

Exceptions
EOutOfBoundaryposition is less than 0 or greater than or equal to getLength().

References trimBoth().

Referenced by compareToNoCase().

◆ getCharacterAt()

int Dragengine.UnicodeString.getCharacterAt ( int position)

Unicode character at the given location.

Exceptions
EOutOfBoundaryposition is less than 0 or greater than or equal to getLength().

Referenced by getLeft().

◆ getLeft()

UnicodeString Dragengine.UnicodeString.getLeft ( int count)

Unicode string with characters from beginning.

Exceptions
EOutOfBoundarycount is less than 0 or greater than or equal to getLength().

References getCharacterAt().

Referenced by getRight().

◆ getLength()

int Dragengine.UnicodeString.getLength ( )

Count of characters in the unicode string.

References getLength().

Referenced by getLength().

◆ getRight()

UnicodeString Dragengine.UnicodeString.getRight ( int count)

Unicode string with characters from the end.

Exceptions
EOutOfBoundarycount is less than 0 or greater than or equal to getLength().

References getLeft().

Referenced by reverse().

◆ getSubString()

UnicodeString Dragengine.UnicodeString.getSubString ( int position,
int count )

Unicode string with characters from middle.

Exceptions
EOutOfBoundaryposition is less than 0 or greater than or equal to getLength().
EOutOfBoundarycount is less than 0 or greater than or equal to getLength().

Referenced by trimLeft().

◆ hashCode()

int Dragengine.UnicodeString.hashCode ( )

Hash code for use as dictionary keys.

Implements Object.hashCode().

References compareTo().

Referenced by toUTF8().

◆ new() [1/3]

UnicodeString Dragengine.UnicodeString.new ( )

Create empty unicode string.

References new().

Referenced by new(), new(), and new().

◆ new() [2/3]

UnicodeString Dragengine.UnicodeString.new ( int character)

Create unicode string from unicode character.

References new().

◆ new() [3/3]

UnicodeString Dragengine.UnicodeString.new ( UnicodeString string)

Create copy of unicode string.

References new().

◆ newFromUTF8()

UnicodeString Dragengine.UnicodeString.newFromUTF8 ( String string)
static

Create unicode string from utf8 encoded string.

References newFromUTF8().

Referenced by newFromUTF8().

◆ operator+() [1/6]

UnicodeString Dragengine.UnicodeString.operator+ ( bool value)

Concatenation of unicode string and boolean value converted to string.

◆ operator+() [2/6]

UnicodeString Dragengine.UnicodeString.operator+ ( byte value)

Concatenation of unicode string and character.

◆ operator+() [3/6]

UnicodeString Dragengine.UnicodeString.operator+ ( float value)

Concatenation of unicode string and floating point value converted to string.

◆ operator+() [4/6]

UnicodeString Dragengine.UnicodeString.operator+ ( int value)

Concatenation of unicode string and integer value converted to string.

References compare().

◆ operator+() [5/6]

UnicodeString Dragengine.UnicodeString.operator+ ( Object object)

Concatenation of unicode string and object value converted to string using Object.toString().

References toFloat(), toInt(), toLower(), toUpper(), and toUTF8().

◆ operator+() [6/6]

UnicodeString Dragengine.UnicodeString.operator+ ( UnicodeString string)

Concatenation of two unicode strings.

◆ reverse()

UnicodeString Dragengine.UnicodeString.reverse ( )

Unicode string with the reversed order of characters.

References getRight().

Referenced by trimBoth().

◆ toFloat()

float Dragengine.UnicodeString.toFloat ( )

Converted to floating point value if possible.

References equals().

Referenced by operator+().

◆ toInt()

int Dragengine.UnicodeString.toInt ( )

Converted to integer if possible.

Referenced by operator+().

◆ toLower()

UnicodeString Dragengine.UnicodeString.toLower ( )

Unicode string with all characters converted to lower case.

References toString().

Referenced by operator+().

◆ toString()

String Dragengine.UnicodeString.toString ( )

UTF8 encoded string.

Referenced by toLower().

◆ toUpper()

UnicodeString Dragengine.UnicodeString.toUpper ( )

Unicode string with all characters converted to upper case.

Referenced by operator+().

◆ toUTF8()

String Dragengine.UnicodeString.toUTF8 ( )

UTF8 encoding of the unicode string.

References hashCode().

Referenced by operator+().

◆ trimBoth()

UnicodeString Dragengine.UnicodeString.trimBoth ( )

Unicode string with white spaces stripped from beginning and end.

References reverse().

Referenced by findCharacterReverse().

◆ trimLeft()

UnicodeString Dragengine.UnicodeString.trimLeft ( )

Unicode string with white spaces stripped from beginning.

References getSubString().

Referenced by findCharacter().

◆ trimRight()

UnicodeString Dragengine.UnicodeString.trimRight ( )

Unicode string with white spaces stripped from the end.

Referenced by findCharacter().


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