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

Mutable unique ID. More...

Inheritance diagram for Dragengine.MutableID:

Public Member Functions

Constructors
MutableID new ()
 Create mutuable unique id with initial value 0.
MutableID new (int value)
 Create mutuable unique id with initial value.
MutableID new (UniqueID id)
 Create mutuable unique id from unique id.
MutableID new (MutableID id)
 Create copy of mutuable unique id.
Management
int getBitCount ()
 Bit count.
void setBitCount (int bitCount)
 Set bit count.
int getByteAt (int position)
 Byte at position in LSB.
void setByteAt (int position, int value)
 Set byte at position in LSB.
void increment ()
 Increment id by 1.
void incrementBy (int amount)
 Increment id by amount.
void incrementBy (UniqueID amount)
 Increment id by UniqueID.
void incrementBy (MutableID amount)
 Increment id by MutableID.
void decrement ()
 Decrement id by 1.
void decrementBy (int amount)
 Decrement id by amount.
void decrementBy (UniqueID amount)
 Decrement id by UniqueID.
void decrementBy (MutableID amount)
 Decrement id by MutableID.
void reset ()
 Reset id to 0 with a bit count of 8.
void setFrom (UniqueID id)
 Copy value of a unique ID.
void setFromMutable (MutableID id)
 Copy value of another mutable ID.
UniqueID toUniqueID ()
 Create unique id from id.
UniqueID nextID ()
 Create unique id from id then increment.
String toHexString ()
 Hex string representation.
void setFromHexString (String string)
 Set from hex string.
String toString ()
 String representation of mutable id.
bool equals (Object other)
 Mutable ID is equal to another object.
int hashCode ()
 Hash code for use as dictionary keys.
File Handling
void readFromFile (FileReader reader)
 Read from file reader.
void writeToFile (FileWriter writer)
 Write to file writer.
Operators
bool operator< (MutableID id)
 ID is less than another ID.
bool operator<= (MutableID id)
 ID is less than or equal to another ID.
bool operator> (MutableID id)
 ID is greater than another ID.
bool operator>= (MutableID id)
 ID is greater than or equal to another ID.

Detailed Description

Mutable unique ID.

This is a native class.

Member Function Documentation

◆ decrement()

void Dragengine.MutableID.decrement ( )

Decrement id by 1.

Referenced by reset().

◆ decrementBy() [1/3]

void Dragengine.MutableID.decrementBy ( int amount)

Decrement id by amount.

References incrementBy().

Referenced by setFromMutable(), and toUniqueID().

◆ decrementBy() [2/3]

void Dragengine.MutableID.decrementBy ( MutableID amount)

Decrement id by MutableID.

References incrementBy().

◆ decrementBy() [3/3]

void Dragengine.MutableID.decrementBy ( UniqueID amount)

Decrement id by UniqueID.

◆ equals()

bool Dragengine.MutableID.equals ( Object other)

Mutable ID is equal to another object.

Implements Object.equals(Object).

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

References nextID().

Referenced by operator<=().

◆ getBitCount()

int Dragengine.MutableID.getBitCount ( )

Bit count.

References getBitCount().

Referenced by getBitCount().

◆ getByteAt()

int Dragengine.MutableID.getByteAt ( int position)

Byte at position in LSB.

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

References setBitCount().

Referenced by setByteAt().

◆ hashCode()

int Dragengine.MutableID.hashCode ( )

Hash code for use as dictionary keys.

Implements Object.hashCode().

References toHexString().

Referenced by operator>=().

◆ increment()

void Dragengine.MutableID.increment ( )

Increment id by 1.

Increases the bit count by 8 if the new value does not fit anymore.

References setByteAt().

Referenced by incrementBy().

◆ incrementBy() [1/3]

void Dragengine.MutableID.incrementBy ( int amount)

Increment id by amount.

Increases the bit count by multiples of 8 if the new value does not fit anymore.

References increment().

Referenced by decrementBy(), decrementBy(), and incrementBy().

◆ incrementBy() [2/3]

void Dragengine.MutableID.incrementBy ( MutableID amount)

Increment id by MutableID.

Increases the bit count by multiples of 8 if the new value does not fit anymore.

◆ incrementBy() [3/3]

void Dragengine.MutableID.incrementBy ( UniqueID amount)

Increment id by UniqueID.

Increases the bit count by multiples of 8 if the new value does not fit anymore.

References incrementBy().

◆ new() [1/4]

MutableID Dragengine.MutableID.new ( )

Create mutuable unique id with initial value 0.

References new().

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

◆ new() [2/4]

MutableID Dragengine.MutableID.new ( int value)

Create mutuable unique id with initial value.

References new().

◆ new() [3/4]

MutableID Dragengine.MutableID.new ( MutableID id)

Create copy of mutuable unique id.

References new().

◆ new() [4/4]

MutableID Dragengine.MutableID.new ( UniqueID id)

Create mutuable unique id from unique id.

References new().

◆ nextID()

UniqueID Dragengine.MutableID.nextID ( )

Create unique id from id then increment.

Convenience call equal to calling toUniqueID() then increment().

References reset().

Referenced by equals().

◆ operator<()

bool Dragengine.MutableID.operator< ( MutableID id)

ID is less than another ID.

◆ operator<=()

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

ID is less than or equal to another ID.

References equals().

◆ operator>()

bool Dragengine.MutableID.operator> ( MutableID id)

ID is greater than another ID.

◆ operator>=()

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

ID is greater than or equal to another ID.

References hashCode(), readFromFile(), and writeToFile().

◆ readFromFile()

void Dragengine.MutableID.readFromFile ( FileReader reader)

Read from file reader.

References setFromHexString().

Referenced by operator>=().

◆ reset()

void Dragengine.MutableID.reset ( )

Reset id to 0 with a bit count of 8.

References decrement().

Referenced by nextID().

◆ setBitCount()

void Dragengine.MutableID.setBitCount ( int bitCount)

Set bit count.

The id is reset to 0 no matter if the bit count changed or not.

Referenced by getByteAt().

◆ setByteAt()

void Dragengine.MutableID.setByteAt ( int position,
int value )

Set byte at position in LSB.

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

References getByteAt().

Referenced by increment().

◆ setFrom()

void Dragengine.MutableID.setFrom ( UniqueID id)

Copy value of a unique ID.

Referenced by toHexString().

◆ setFromHexString()

void Dragengine.MutableID.setFromHexString ( String string)

Set from hex string.

References setFromMutable().

Referenced by readFromFile().

◆ setFromMutable()

void Dragengine.MutableID.setFromMutable ( MutableID id)

Copy value of another mutable ID.

References decrementBy().

Referenced by setFromHexString().

◆ toHexString()

String Dragengine.MutableID.toHexString ( )

Hex string representation.

References setFrom().

Referenced by hashCode().

◆ toString()

String Dragengine.MutableID.toString ( )

String representation of mutable id.

References toUniqueID().

Referenced by writeToFile().

◆ toUniqueID()

UniqueID Dragengine.MutableID.toUniqueID ( )

Create unique id from id.

References decrementBy().

Referenced by toString().

◆ writeToFile()

void Dragengine.MutableID.writeToFile ( FileWriter writer)

Write to file writer.

References toString().

Referenced by operator>=().


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