alice.tuprolog
Class Number

java.lang.Object
  extended byalice.tuprolog.Term
      extended byalice.tuprolog.Number
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
Double, Float, Int, Long

public abstract class Number
extends Term

Number abstract class represents numbers prolog data type

See Also:
Int, Long, Float, Double, Serialized Form

Field Summary
 
Fields inherited from class alice.tuprolog.Term
FALSE, TRUE
 
Constructor Summary
Number()
           
 
Method Summary
 Term copy(int idExecCtx)
          gets a copy of this term.
static Number createNumber(java.lang.String s)
           
abstract  double doubleValue()
          Returns the value of the number as double
abstract  float floatValue()
          Returns the value of the number as float
 void free()
          Unlink variables inside the term
 Term getTerm()
          Gets the actual term referred by this Term.
abstract  int intValue()
          Returns the value of the number as int
 boolean isAtom()
          is this term a prolog (alphanumeric) atom?
 boolean isAtomic()
          is this term a constant prolog term?
 boolean isCompound()
          is this term a prolog compound term?
abstract  boolean isDouble()
          Deprecated. Use instanceof alice.tuprolog.Double instead.
 boolean isEmptyList()
          is this term a null term?
abstract  boolean isFloat()
          Deprecated. Use instanceof alice.tuprolog.Float instead.
 boolean isGround()
          is this term a ground term?
abstract  boolean isInt()
          Deprecated. Use instanceof Int instead.
abstract  boolean isInteger()
          is this term a prolog integer term?
 boolean isList()
          is this term a prolog list?
abstract  boolean isLong()
          Deprecated. Use instanceof alice.tuprolog.Long instead.
 boolean isNumber()
          is this term a prolog numeric term?
abstract  boolean isReal()
          is this term a prolog real term?
 boolean isStruct()
          is this term a struct
abstract  boolean isTypeDouble()
          Deprecated. Use instanceof alice.tuprolog.Double instead.
abstract  boolean isTypeFloat()
          Deprecated. Use instanceof alice.tuprolog.Float instead.
abstract  boolean isTypeInt()
          Deprecated. Use instanceof Int instead.
abstract  boolean isTypeLong()
          Deprecated. Use instanceof alice.tuprolog.Long instead.
 boolean isVar()
          is this term a variable
abstract  long longValue()
          Returns the value of the number as long
 
Methods inherited from class alice.tuprolog.Term
copyGoal, copyResult, createTerm, createTerm, equals, getIterator, isEqual, isGreater, iteratedGoalTerm, match, parse, parse, resolveTerm, unify
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Number

public Number()
Method Detail

intValue

public abstract int intValue()
Returns the value of the number as int


floatValue

public abstract float floatValue()
Returns the value of the number as float


longValue

public abstract long longValue()
Returns the value of the number as long


doubleValue

public abstract double doubleValue()
Returns the value of the number as double


isInteger

public abstract boolean isInteger()
is this term a prolog integer term?


isReal

public abstract boolean isReal()
is this term a prolog real term?


isTypeInt

public abstract boolean isTypeInt()
Deprecated. Use instanceof Int instead.

is an int Integer number?


isInt

public abstract boolean isInt()
Deprecated. Use instanceof Int instead.

is an int Integer number?


isTypeFloat

public abstract boolean isTypeFloat()
Deprecated. Use instanceof alice.tuprolog.Float instead.

is a float Real number?


isFloat

public abstract boolean isFloat()
Deprecated. Use instanceof alice.tuprolog.Float instead.

is a float Real number?


isTypeDouble

public abstract boolean isTypeDouble()
Deprecated. Use instanceof alice.tuprolog.Double instead.

is a double Real number?


isDouble

public abstract boolean isDouble()
Deprecated. Use instanceof alice.tuprolog.Double instead.

is a double Real number?


isTypeLong

public abstract boolean isTypeLong()
Deprecated. Use instanceof alice.tuprolog.Long instead.

is a long Integer number?


isLong

public abstract boolean isLong()
Deprecated. Use instanceof alice.tuprolog.Long instead.

is a long Integer number?


createNumber

public static Number createNumber(java.lang.String s)
                           throws InvalidTermException
Throws:
InvalidTermException

getTerm

public Term getTerm()
Gets the actual term referred by this Term.

Specified by:
getTerm in class Term

isNumber

public final boolean isNumber()
is this term a prolog numeric term?

Specified by:
isNumber in class Term

isStruct

public final boolean isStruct()
is this term a struct

Specified by:
isStruct in class Term

isVar

public final boolean isVar()
is this term a variable

Specified by:
isVar in class Term

isEmptyList

public final boolean isEmptyList()
Description copied from class: Term
is this term a null term?

Specified by:
isEmptyList in class Term

isAtomic

public final boolean isAtomic()
is this term a constant prolog term?

Specified by:
isAtomic in class Term

isCompound

public final boolean isCompound()
is this term a prolog compound term?

Specified by:
isCompound in class Term

isAtom

public final boolean isAtom()
is this term a prolog (alphanumeric) atom?

Specified by:
isAtom in class Term

isList

public final boolean isList()
is this term a prolog list?

Specified by:
isList in class Term

isGround

public final boolean isGround()
is this term a ground term?

Specified by:
isGround in class Term

copy

public Term copy(int idExecCtx)
gets a copy of this term.


free

public void free()
Description copied from class: Term
Unlink variables inside the term

Specified by:
free in class Term