Class IStateInt

  • Direct Known Subclasses:
    StoredInt

    public abstract class IStateInt
    extends Object
    An abstract class for backtrackable int.
    Since:
    29/04/13
    Author:
    Charles Prud'homme
    • Field Detail

      • currentValue

        protected int currentValue
      • timeStamp

        protected int timeStamp
    • Constructor Detail

    • Method Detail

      • get

        public final int get()
        Returns the current value.
      • set

        public abstract void set​(int y)
        Modifies the value and stores if needed the former value on the trailing stack.
      • add

        public final int add​(int delta)
        modifying a StoredInt by an increment
        Parameters:
        delta - increment value
        Returns:
        the new value
      • _set

        public void _set​(int y,
                         int wstamp)
        Modifies the value without storing the former value on the trailing stack.
        Parameters:
        y - the new value
        wstamp - the stamp of the world in which the update is performed
      • overrideTimeStamp

        public void overrideTimeStamp​(int aTimeStamp)