Module org.maxicp

Class Copy<T>

java.lang.Object
org.maxicp.state.copy.Copy<T>
Type Parameters:
T - the type of the value wrapped in this state
All Implemented Interfaces:
State<T>, Storage
Direct Known Subclasses:
CopyInt, CopyLong

public class Copy<T> extends Object implements Storage, State<T>
Implementation of State with copy strategy
See Also:
  • Constructor Details

    • Copy

      protected Copy(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
    • save

      public StateEntry save()
      Specified by:
      save in interface Storage