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
Base class for all numeric terms.
- See Also:
-
Field Summary
FieldsFields inherited from class com.igormaznitsa.prologparser.terms.PrologTerm
quotation, text -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract NumberGet numeric representation of the saved number.getText()Get the term text.final TermTypegetType()Get term type.abstract booleanCheck that the number is negative oneabstract PrologNumericmakeNeg()Make negative representation of the numeric termMethods inherited from class com.igormaznitsa.prologparser.terms.PrologTerm
assertNonEmptyString, compareTo, findQuotation, flatComma, getArity, getFunctor, getLine, getPos, getPrecedence, getQuotation, isAnyBlock, isBlock, isCurlyBlock, setLine, setPos, stream, toString
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
-
Constructor Details
-
PrologNumeric
public PrologNumeric() -
PrologNumeric
public PrologNumeric(int line, int pos)
-
-
Method Details
-
getNumber
Get numeric representation of the saved number.- Returns:
- the saved number
-
getType
Description copied from class:PrologTermGet term type.- Specified by:
getTypein classPrologTerm- Returns:
- term type, must not be null
-
getText
Description copied from class:PrologTermGet the term text.- Overrides:
getTextin classPrologTerm- 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
Make negative representation of the numeric term- Returns:
- the negative variant of the numeric
-