jpl
public abstract class Term extends Object
Copyright (C) 1998 Fred Dushin
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library Public License for more details.
Method Summary | |
---|---|
Term | arg(int ano)
returns the ano-th (1+) argument of a (Compound) Term
throws a JPLException for any other subclass
|
abstract Term[] | args()
returns, as a Term[], the arguments of a Compound
returns an empty Term[] from an Atom, Integer or Float
throws a JPLException from a Variable
|
int | arity()
returns, as an int, the arity of a Compound, Atom, Integer or Float
throws a JPLException from a Variable
|
abstract String | debugString()
Returns a debug-friendly representation of a Term
|
static String | debugString(Term[] arg)
Returns a debug-friendly representation of a list of Terms
|
double | doubleValue()
returns the value (as a double) of an Integer or Float
throws a JPLException from any other subclass
|
float | floatValue()
returns the value (as a float) of an Integer or Float
throws a JPLException from a Compound, Atom or Variable
|
boolean | hasFunctor(String name, int arity)
Tests whether this Term's functor has (String) 'name' and 'arity'
Returns false if called inappropriately
|
boolean | hasFunctor(int value, int arity)
Tests whether this Term's functor has (int) 'name' and 'arity'
Returns false if called inappropriately
|
boolean | hasFunctor(double value, int arity)
Tests whether this Term's functor has (double) 'name' and 'arity'
Returns false if called inappropriately
|
int | intValue()
returns the value (as an int) of an Integer or Float
throws a JPLException from a Compound, Atom or Variable
|
boolean | isAtom()
whether this Term represents an atom
|
boolean | isCompound()
whether this Term represents a compound term
|
boolean | isFloat()
whether this Term represents an atom
|
boolean | isInteger()
whether this Term represents an atom
|
boolean | isJFalse()
whether this Term is a 'jfalse' structure, i.e. |
boolean | isJNull()
whether this Term is a 'jnull' structure, i.e. |
boolean | isJObject()
whether this Term is a 'jobject' structure, i.e. |
boolean | isJRef()
whether this Term is a 'jref' structure, i.e. |
boolean | isJTrue()
whether this Term is a 'jtrue' structure, i.e. |
boolean | isJVoid()
whether this Term is a 'jvoid' structure, i.e. |
boolean | isVariable()
whether this Term is a variable
|
int | listLength()
the length of this list, iff it is one, else an exception is thrown
|
long | longValue()
returns the value (as a long) of an Integer or Float
throws a JPLException from a Compound, Atom or Variable
|
String | name()
returns, as a String, the name of a Compound, Atom or Variable
throws a JPLException from an Integer or Float
|
void | put(term_t term) |
Term | putParams(Term[] ps) |
Term | putParams(Term plist) |
static void | putTerm(Object obj, term_t termref) |
static String | toString(Term[] args)
Converts a list of Terms to a String.
|
Term[] | toTermArray() returns an array of terms which are the successive members of this list, if it is a list, else throws an exception
|
abstract int | type()
returns the type of this term, as one of jpl.fli.Prolog.COMPOUND, .ATOM, .VARIABLE, .INTEGER, .FLOAT etc
|
abstract String | typeName()
returns the name of the type of this term, as one of "Compound", "Atom", "Variable", "Integer", "Float" etc
|
Returns: the ano-th argument of a (Compound) Term
Returns: the arguments of a Compound as a Term[
Returns: the arity of a Compound, Atom, Integer or Float
Deprecated:
Returns a debug-friendly representation of a TermReturns: a debug-friendly representation of a Term
Deprecated:
Returns a debug-friendly representation of a list of TermsReturns: a debug-friendly representation of a list of Terms
Returns: the value (as an double) of an Integer or Float
Returns: the value (as a float) of an Integer or Float
Returns: whether this Term's functor has (String) 'name' and 'arity'
Returns: whether this Term's functor has (int) 'name' and 'arity'
Returns: whether this Term's functor has (double) 'name' and 'arity'
Returns: the value (as an int) of an Integer or Float
Returns: whether this Term represents an atom
Returns: whether this Term represents a compound atom
Returns: whether this Term represents an atom
Returns: whether this Term represents an atom
Returns: whether this Term is a 'jfalse' structure, i.e. @(false)
Returns: whether this Term is a 'jnull' structure, i.e. @(null)
Returns: whether this Term is a 'jobject' structure, i.e. @(Tag)
Returns: whether this Term is a 'jref' structure, i.e. @(Tag) or @(null)
Returns: whether this Term is a 'jtrue' structure, i.e. @(true)
Returns: whether this Term is a 'jvoid' structure, i.e. @(void)
Returns: whether this Term is a variable
Returns: the length (as an int) of this list, iff it is one
Throws: JPLException
Returns: the value (as a long) of an Integer or Float
Returns: the name of a Compound, Atom or Variable
Parameters: args An array of Terms to convert
Returns: String representation of a list of Terms
Returns: an array of terms which are the successive members of this list, if it is a list
Throws: JPLException
Returns: the type of this term, as one of jpl.fli.Prolog.COMPOUND, .ATOM, .VARIABLE, .INTEGER, .FLOAT etc
Returns: the name of the type of this term, as one of "Compound", "Atom", "Variable", "Integer", "Float" etc