com.svincent.moksa
Class WamInteger

java.lang.Object
  |
  +--com.svincent.moksa.WamObject
        |
        +--com.svincent.moksa.PrologTerm
              |
              +--com.svincent.moksa.WamInteger
All Implemented Interfaces:
Trailable

public class WamInteger
extends PrologTerm

A WamInteger is a Prolog constant for an integral number.


Fields inherited from class com.svincent.moksa.PrologTerm
EmptyArray
 
Constructor Summary
WamInteger(PrologEngine _engine, int _value)
          Builds a new WamInteger with the given name.
 
Method Summary
 java.lang.Object accept(PrologTermVisitor v, java.lang.Object parm)
          Allow PrologTermVisitor to access this PrologTerm.
 PrologTerm clonePrologTerm(java.util.Map objs)
           
 PrologTerm evaluateExpression()
          Evaluates this term as an expression.
 java.lang.String getName()
          Retrieves this WamInteger's name.
 PrologTerm getNameConstant()
          Retrieves this WamInteger's name as a term.
 int intValue()
          Returns this Integer's integral value.
 boolean isConstant()
          Returns true iff this is a constant.
 boolean isInteger()
          Returns true iff this is a WamInteger.
 void tag(java.io.PrintWriter out)
          Writes a short human-readable representation of this object to the given Writer.
 boolean unify(PrologTerm _that, boolean doBindings)
          Unification algorithm.
 
Methods inherited from class com.svincent.moksa.PrologTerm
clonePrologTerm, deref, floatValue, getArity, getPriority, isAtom, isCompoundTerm, isEmptyList, isFloat, isJavaObject, isList, isNonEmptyList, isStreamId, isStructure, isVariable, printVariables, setPriority, unify, unifyWithoutBindings, untrail
 
Methods inherited from class com.svincent.moksa.WamObject
tag
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WamInteger

public WamInteger(PrologEngine _engine,
                  int _value)
Builds a new WamInteger with the given name. Note that WamIntegers are intended to be used as constants, so no building API is provided.

Method Detail

getName

public java.lang.String getName()
Retrieves this WamInteger's name.
Overrides:
getName in class PrologTerm

getNameConstant

public PrologTerm getNameConstant()
Retrieves this WamInteger's name as a term.
Overrides:
getNameConstant in class PrologTerm

isInteger

public boolean isInteger()
Returns true iff this is a WamInteger.
Overrides:
isInteger in class PrologTerm

isConstant

public boolean isConstant()
Returns true iff this is a constant.
Overrides:
isConstant in class PrologTerm

intValue

public int intValue()
Returns this Integer's integral value.
Overrides:
intValue in class PrologTerm

accept

public java.lang.Object accept(PrologTermVisitor v,
                               java.lang.Object parm)
Allow PrologTermVisitor to access this PrologTerm.
Overrides:
accept in class PrologTerm

unify

public boolean unify(PrologTerm _that,
                     boolean doBindings)
Unification algorithm. Can cause variables to become bound. (We will eventually have a rollback mechanism to undo these bindings.)

Overrides:
unify in class PrologTerm
Returns:
true iff the two PrologTerms successfully unify.

clonePrologTerm

public PrologTerm clonePrologTerm(java.util.Map objs)
Overrides:
clonePrologTerm in class PrologTerm

evaluateExpression

public PrologTerm evaluateExpression()
                              throws PrologException
Evaluates this term as an expression.
Overrides:
evaluateExpression in class PrologTerm

tag

public void tag(java.io.PrintWriter out)
Description copied from class: WamObject
Writes a short human-readable representation of this object to the given Writer.

Overrides:
tag in class WamObject



This is documentation for Moksa Prolog, which can be found at http://www.svincent.com/moksa/

Copyright © 1999 Shawn P. Vincent.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.