Package com.nomagic.util
Class Counter
- java.lang.Object
-
- com.nomagic.util.Counter
-
- All Implemented Interfaces:
java.io.Serializable
public class Counter extends java.lang.Object implements java.io.Serializable
this class represents object for generating ID for DTObjects, these ID are of String class, but also their represent hexadecimal code- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
canResetID
Can id be reseted.private long
currentID
current ID in decimal code
-
Constructor Summary
Constructors Constructor Description Counter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canChangeTo(java.lang.String oldID, java.lang.String newID)
Returns true, if this given old id can be changed to other new id.boolean
canResetIDForObject()
Return can reset id flag value.java.lang.String
getObjectID()
generating new IDvoid
reset()
reset counter to 0void
setCanResetIDForObject(boolean value)
Sets can reset id flag.
-
-
-
Method Detail
-
getObjectID
public java.lang.String getObjectID()
generating new ID- Returns:
- new ID for Element
-
canChangeTo
public boolean canChangeTo(java.lang.String oldID, java.lang.String newID)
Returns true, if this given old id can be changed to other new id.
-
reset
public void reset()
reset counter to 0
-
setCanResetIDForObject
public void setCanResetIDForObject(boolean value)
Sets can reset id flag.- Parameters:
value
- new flag value.
-
canResetIDForObject
public boolean canResetIDForObject()
Return can reset id flag value.- Returns:
- reset flag value.
-
-