- java.lang.Object
-
- com.igormaznitsa.prologparser.terms.PrologTerm
-
- com.igormaznitsa.prologparser.terms.PrologNumeric
-
- com.igormaznitsa.prologparser.terms.PrologInt
-
- All Implemented Interfaces:
Serializable,Comparable<PrologTerm>
public final class PrologInt extends PrologNumeric
Representation of integer numeric term.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class com.igormaznitsa.prologparser.terms.PrologTerm
quotation, text
-
-
Constructor Summary
Constructors Constructor Description PrologInt(long value)PrologInt(long value, int line, int pos)PrologInt(String text)PrologInt(String text, int line, int pos)PrologInt(BigInteger value)PrologInt(BigInteger value, int line, int pos)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BigIntegergetIntValue()Get the value as BigIntegerNumbergetNumber()Get numeric representation of the saved number.StringgetText()Get the term text.booleanisNegative()Check that the number is negative onePrologNumericmakeNeg()Make negative representation of the numeric termStringtoString()-
Methods inherited from class com.igormaznitsa.prologparser.terms.PrologNumeric
getType
-
Methods inherited from class com.igormaznitsa.prologparser.terms.PrologTerm
assertNonEmptyString, compareTo, findQuotation, flatComma, getArity, getFunctor, getLine, getPos, getPrecedence, getQuotation, isAnyBlock, isBlock, isCurlyBlock, setLine, setPos, stream
-
-
-
-
Constructor Detail
-
PrologInt
public PrologInt(String text)
-
PrologInt
public PrologInt(String text, int line, int pos)
-
PrologInt
public PrologInt(long value)
-
PrologInt
public PrologInt(long value, int line, int pos)
-
PrologInt
public PrologInt(BigInteger value)
-
PrologInt
public PrologInt(BigInteger value, int line, int pos)
-
-
Method Detail
-
makeNeg
public PrologNumeric makeNeg()
Description copied from class:PrologNumericMake negative representation of the numeric term- Specified by:
makeNegin classPrologNumeric- Returns:
- the negative variant of the numeric
-
toString
public String toString()
- Overrides:
toStringin classPrologTerm
-
getText
public String getText()
Description copied from class:PrologTermGet the term text.- Overrides:
getTextin classPrologNumeric- Returns:
- the term text, must not be null
-
getNumber
public Number getNumber()
Description copied from class:PrologNumericGet numeric representation of the saved number.- Specified by:
getNumberin classPrologNumeric- Returns:
- the saved number
-
getIntValue
public BigInteger getIntValue()
Get the value as BigInteger- Returns:
- the value as BigInteger
-
isNegative
public boolean isNegative()
Description copied from class:PrologNumericCheck that the number is negative one- Specified by:
isNegativein classPrologNumeric- Returns:
- true if the number is negative one, false otherwise
-
-