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

Immutable unique ID. More...

Inheritance diagram for Dragengine.UniqueID:

Public Member Functions

Constructors
UniqueID new ()
 Create unique id with value 0.
UniqueID new (int value)
 Create unique id with value.
Operators
UniqueID operator+ (int value)
 UniqueID incremented by value.
UniqueID operator+ (UniqueID id)
 UniqueID incremented by another UniqueID.
UniqueID operator- (int value)
 UniqueID decremented by value.
UniqueID operator- (UniqueID id)
 UniqueID decremented by another UniqueID.
bool operator< (UniqueID id)
 ID is less than another ID.
bool operator<= (UniqueID id)
 ID is less than or equal to another ID.
bool operator> (UniqueID id)
 ID is greater than another ID.
bool operator>= (UniqueID id)
 ID is greater than or equal to another ID.

Management

int getBitCount ()
 Bit count.
int getByteAt (int position)
 Byte at position in LSB.
String toHexString ()
 Hex string representation.
bool zero ()
 ID is 0.
bool notZero ()
 ID is not 0.
String toString ()
 String representation of unique id.
bool equals (Object other)
 Unique ID is equal to another object.
int compare (Object obj)
 Compare object with another object.
int hashCode ()
 Hash code for use as dictionary keys.
static UniqueID newFromHexString (String string)
 Unique id from hex string.

File Handling

void writeToFile (FileWriter writer)
 Write unique id to a file writer.
static UniqueID readFromFile (FileReader reader)
 Read unique id from a file reader.

Detailed Description

Immutable unique ID.

This is a native class.

Member Function Documentation

◆ compare()

int Dragengine.UniqueID.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.

Referenced by writeToFile().

◆ equals()

bool Dragengine.UniqueID.equals ( Object other)

Unique ID is equal to another object.

Implements Object.equals(Object).

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

References notZero(), and toString().

Referenced by hashCode().

◆ getBitCount()

int Dragengine.UniqueID.getBitCount ( )

Bit count.

References getBitCount().

Referenced by getBitCount().

◆ getByteAt()

int Dragengine.UniqueID.getByteAt ( int position)

Byte at position in LSB.

Exceptions
EOutOfBoundaryposition is less than 0 or larger than or equal to getBitCount().

References getByteAt().

Referenced by getByteAt().

◆ hashCode()

int Dragengine.UniqueID.hashCode ( )

Hash code for use as dictionary keys.

Implements Object.hashCode().

References equals().

Referenced by operator+().

◆ new() [1/2]

UniqueID Dragengine.UniqueID.new ( )

Create unique id with value 0.

References new().

Referenced by new(), and new().

◆ new() [2/2]

UniqueID Dragengine.UniqueID.new ( int value)

Create unique id with value.

References new().

◆ newFromHexString()

UniqueID Dragengine.UniqueID.newFromHexString ( String string)
static

Unique id from hex string.

References toHexString().

Referenced by zero().

◆ notZero()

bool Dragengine.UniqueID.notZero ( )

ID is not 0.

Version
1.26

References zero().

Referenced by equals().

◆ operator+() [1/2]

UniqueID Dragengine.UniqueID.operator+ ( int value)

UniqueID incremented by value.

References hashCode().

◆ operator+() [2/2]

UniqueID Dragengine.UniqueID.operator+ ( UniqueID id)

UniqueID incremented by another UniqueID.

◆ operator-() [1/2]

UniqueID Dragengine.UniqueID.operator- ( int value)

UniqueID decremented by value.

◆ operator-() [2/2]

UniqueID Dragengine.UniqueID.operator- ( UniqueID id)

UniqueID decremented by another UniqueID.

References readFromFile().

◆ operator<()

bool Dragengine.UniqueID.operator< ( UniqueID id)

ID is less than another ID.

◆ operator<=()

bool Dragengine.UniqueID.operator<= ( UniqueID id)

ID is less than or equal to another ID.

References writeToFile().

◆ operator>()

bool Dragengine.UniqueID.operator> ( UniqueID id)

ID is greater than another ID.

◆ operator>=()

bool Dragengine.UniqueID.operator>= ( UniqueID id)

ID is greater than or equal to another ID.

◆ readFromFile()

UniqueID Dragengine.UniqueID.readFromFile ( FileReader reader)
static

Read unique id from a file reader.

Referenced by operator-().

◆ toHexString()

String Dragengine.UniqueID.toHexString ( )

Hex string representation.

Referenced by newFromHexString().

◆ toString()

String Dragengine.UniqueID.toString ( )

String representation of unique id.

Referenced by equals().

◆ writeToFile()

void Dragengine.UniqueID.writeToFile ( FileWriter writer)

Write unique id to a file writer.

References compare().

Referenced by operator<=().

◆ zero()

bool Dragengine.UniqueID.zero ( )

ID is 0.

Version
1.26

References newFromHexString().

Referenced by notZero().


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