Package org.jparsec

Class WithSource<T>


  • public final class WithSource<T>
    extends java.lang.Object
    Parsed result with the matched source text.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.String source  
      private T value  
    • Constructor Summary

      Constructors 
      Constructor Description
      WithSource​(T value, java.lang.String source)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object o)  
      java.lang.String getSource()
      Returns the underlying source text.
      T getValue()
      Returns the parsed result.
      int hashCode()  
      java.lang.String toString()
      Returns the underlying source text.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • value

        private final T value
      • source

        private final java.lang.String source
    • Constructor Detail

      • WithSource

        public WithSource​(T value,
                          java.lang.String source)
    • Method Detail

      • getValue

        public T getValue()
        Returns the parsed result.
      • getSource

        public java.lang.String getSource()
        Returns the underlying source text. Never null.
      • toString

        public java.lang.String toString()
        Returns the underlying source text.
        Overrides:
        toString in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object