Class CurrentScrollPosition

java.lang.Object
com.thecoderscorner.menu.domain.state.CurrentScrollPosition

public class CurrentScrollPosition extends Object
Represents a scroll position as used by ScrollChoiceMenuItems, it holds the position and the current string value.
  • Constructor Details

    • CurrentScrollPosition

      public CurrentScrollPosition(int position, String value)
      Create from the position and value
      Parameters:
      position - the current position
      value - the current value
    • CurrentScrollPosition

      public CurrentScrollPosition(String text)
      Create from a textual representation in the form, position-value, EG 1-Pizza
      Parameters:
      text - the text form of the object to parse
  • Method Details

    • getPosition

      public int getPosition()
      Returns:
      the current position
    • getValue

      public String getValue()
      Returns:
      the current value
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • setTextValue

      public void setTextValue(Object txt)
      Allows the value to be changed just after creation, this is for local UIs where the setting happens just after creation of the state.
      Parameters:
      txt - the new value