io.github.JalogTeam.jalog
Class Jalog.Term

java.lang.Object
  extended by io.github.JalogTeam.jalog.Jalog.Term
Enclosing class:
Jalog

public class Jalog.Term

Data of class Jalog.Term are used by the Jalog inference engine. The methods of Jalog.Term are used to extract the values of terms for normal use in Java programs.

Functions to create data items of type Jalog.Term are found in Jalog class.


 

Method Summary
 char getCharacterValue()
           Gets the char out of the Jalog.Term, if present.
 Jalog.Term[] getElements()
           Converts a Jalog list to a Jalog.Term array, if present.
 String getFunctor()
           Gets the functor name of a compound Jalog.Term, if present.
 long getIntegerValue()
           Gets the long integer value out of the Jalog.Term, if present.
 double getRealValue()
           Gets the double value out of the Jalog.Term, if present.
 String getStringValue()
           Gets the String value of the Jalog.Term, if present.
 Jalog.Term[] getSubTerms()
           Gets the subterms out of the Jalog.Term of compound type, if present.
 String getSymbolValue()
           Gets the symbol value of the Jalog.Term of symbol, if present.
 String getType()
           Gets the type code of the Jalog.Term.
 

Method Detail

getCharacterValue

public char getCharacterValue()
Gets the char out of the Jalog.Term.

Returns:
the char value if present, otherwise '\uFFFF'.

getElements

public Jalog.Term[] getElements()
Converts a Jalog list to a Jalog.Term array.

Returns:
an array of the list values for a list, otherwise null.

getFunctor

public String getFunctor()
Gets the name of the functor of the compound Jalog.Term.

Returns:
the functor of a compound Term as a String, null for other types.

getIntegerValue

public long getIntegerValue()
Gets the long out of the Jalog.Term.

Returns:
the long value if the term is numeric. Integers are as such, reals are typecast to long, Other types return 0.

getRealValue

public double getRealValue()
Gets the double value out of the Jalog.Term.

Returns:
the double value for numeric terms. Real values are as such, integers are typecast to double, other types return 0.0.

getStringValue

public String getStringValue()
Gets the String out of the Jalog.Term.

Returns:
the String value if present, otherwise null.

getSubTerms

public Jalog.Term[] getSubTerms()
Collects the subterms of a Jalog compound term to an array.

Returns:
a Jalog.Term array of the arguments for a compound; null for other types.

getSymbolValue

public String getSymbolValue()
Gets the name of the symbol.

Returns:
the name of the symbol, null for other Term types.

getType

public String getType()
Gets the type name of the Jalog.Term.

Returns:
the type name string. One of Jalog.OPEN, Jalog.INTEGER, Jalog.SYMBOL, Jalog.REAL, Jalog.CHARACTER, Jalog.STRING, Jalog.LIST, or Jalog.COMPOUND. See Jalog Field Summary.

Authors: Mikko Levanto, Ari Okkonen