Class Parsed<T>


  • public class Parsed<T>
    extends Object
    The return type of Parser.parse(String,int) methods. Records the parsed value and position from which parsing should resume.
    • Constructor Detail

      • Parsed

        public Parsed​(T value,
                      int pos)
        Constructs a new Parsed object to record the given fields.
        Parameters:
        value - the parsed value
        pos - the position from which parsing should resume
    • Method Detail

      • getValue

        public T getValue()
        Gets the parsed value.
        Returns:
        T
      • getPos

        public int getPos()
        Gets the position from which parsing should resume.
        Returns:
        int
      • equals

        public boolean equals​(Object o)
        Compares some other object to this one for equality. Both value and pos are compared.
        Overrides:
        equals in class Object
        Parameters:
        o - the other object
        Returns:
        boolean
      • hashCode

        public int hashCode()
        Gets a hash code value for this object.
        Overrides:
        hashCode in class Object
        Returns:
        int
      • toString

        public String toString()
        Returns a printable representation of this, in the form "{value,pos}".
        Overrides:
        toString in class Object
        Returns:
        String