Class 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 ID
      void reset()
      reset counter to 0
      void setCanResetIDForObject​(boolean value)
      Sets can reset id flag.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • canResetID

        private volatile boolean canResetID
        Can id be reseted.
      • currentID

        private long currentID
        current ID in decimal code
    • Constructor Detail

      • Counter

        public Counter()
    • 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.