Module org.maxicp

Class Trail<T>

java.lang.Object
org.maxicp.state.trail.Trail<T>
Type Parameters:
T - the type of the value wrapped in this state
All Implemented Interfaces:
State<T>
Direct Known Subclasses:
TrailInt, TrailLong

public class Trail<T> extends Object implements State<T>
Implementation of State with trail strategy
See Also:
  • Constructor Details

    • Trail

      protected Trail(Trailer trail, T initial)
  • Method Details

    • setValue

      public T setValue(T v)
      Description copied from interface: State
      Set the value
      Specified by:
      setValue in interface State<T>
      Parameters:
      v - the value to set
      Returns:
      the new value that was set
    • value

      public T value()
      Description copied from interface: State
      Retrieves the value
      Specified by:
      value in interface State<T>
      Returns:
      the value
    • toString

      public String toString()
      Specified by:
      toString in interface State<T>
      Overrides:
      toString in class Object