Class Parsed<T>
- java.lang.Object
-
- 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.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
Compares some other object to this one for equality.int
getPos()
Gets the position from which parsing should resume.T
getValue()
Gets the parsed value.int
hashCode()
Gets a hash code value for this object.String
toString()
Returns a printable representation of this, in the form "{value,pos}".
-
-
-
Constructor Detail
-
Parsed
public Parsed(T value, int pos)
Constructs a new Parsed object to record the given fields.- Parameters:
value
- the parsed valuepos
- 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.
-
hashCode
public int hashCode()
Gets a hash code value for this object.
-
-