Class PrologNumeric

java.lang.Object
com.igormaznitsa.prologparser.terms.PrologTerm
com.igormaznitsa.prologparser.terms.PrologNumeric
All Implemented Interfaces:
Serializable, Comparable<PrologTerm>
Direct Known Subclasses:
PrologFloat, PrologInt

public abstract class PrologNumeric extends PrologTerm
Base class for all numeric terms.
See Also:
  • Field Details

  • Constructor Details

    • PrologNumeric

      public PrologNumeric()
    • PrologNumeric

      public PrologNumeric(int line, int pos)
  • Method Details

    • getNumber

      public abstract Number getNumber()
      Get numeric representation of the saved number.
      Returns:
      the saved number
    • getType

      public final TermType getType()
      Description copied from class: PrologTerm
      Get term type.
      Specified by:
      getType in class PrologTerm
      Returns:
      term type, must not be null
    • getText

      public String getText()
      Description copied from class: PrologTerm
      Get the term text.
      Overrides:
      getText in class PrologTerm
      Returns:
      the term text, must not be null
    • isNegative

      public abstract boolean isNegative()
      Check that the number is negative one
      Returns:
      true if the number is negative one, false otherwise
    • makeNeg

      public abstract PrologNumeric makeNeg()
      Make negative representation of the numeric term
      Returns:
      the negative variant of the numeric