Class PrologInt
java.lang.Object
com.igormaznitsa.prologparser.terms.PrologTerm
com.igormaznitsa.prologparser.terms.PrologNumeric
com.igormaznitsa.prologparser.terms.PrologInt
- All Implemented Interfaces:
Serializable,Comparable<PrologTerm>
Representation of integer numeric term.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Map<String, BigInteger> private static final longprivate final BigIntegerFields inherited from class com.igormaznitsa.prologparser.terms.PrologTerm
quotation, text -
Constructor Summary
ConstructorsConstructorDescriptionPrologInt(long value) PrologInt(long value, int line, int pos) PrologInt(BigInteger value) PrologInt(BigInteger value, int line, int pos) -
Method Summary
Modifier and TypeMethodDescriptionGet the value as BigIntegerGet numeric representation of the saved number.getText()Get the term text.booleanCheck that the number is negative onemakeNeg()Make negative representation of the numeric termtoString()private static BigIntegerMethods inherited from class com.igormaznitsa.prologparser.terms.PrologNumeric
getTypeMethods inherited from class com.igormaznitsa.prologparser.terms.PrologTerm
assertNonEmptyString, compareTo, findQuotation, flatComma, getArity, getFunctor, getLine, getPos, getPrecedence, getQuotation, isAnyBlock, isBlock, isCurlyBlock, setLine, setPos, stream
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
cachedValues
-
value
-
-
Constructor Details
-
PrologInt
-
PrologInt
-
PrologInt
public PrologInt(long value) -
PrologInt
public PrologInt(long value, int line, int pos) -
PrologInt
-
PrologInt
-
-
Method Details
-
valueOf
-
makeNeg
Description copied from class:PrologNumericMake negative representation of the numeric term- Specified by:
makeNegin classPrologNumeric- Returns:
- the negative variant of the numeric
-
toString
- Overrides:
toStringin classPrologTerm
-
getText
Description copied from class:PrologTermGet the term text.- Overrides:
getTextin classPrologNumeric- Returns:
- the term text, must not be null
-
getNumber
Description copied from class:PrologNumericGet numeric representation of the saved number.- Specified by:
getNumberin classPrologNumeric- Returns:
- the saved number
-
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
-