Package org.prolog4j
Class Compound
- java.lang.Object
-
- org.prolog4j.Compound
-
- All Implemented Interfaces:
Serializable
public class Compound extends Object implements Serializable
Represents a Prolog compound term. Prolog compound terms for which no default way of conversion exists will be converted to a Compound object.- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)ObjectgetArg(int index)Returns the index-th argument of the compound term.Object[]getArgs()Returns the arguments of the compound term.intgetArity()Returns the arity (the number of arguments) of the compound term.StringgetFunctor()Returns the functor of the compound term.inthashCode()StringtoString()
-
-
-
Method Detail
-
getFunctor
public String getFunctor()
Returns the functor of the compound term.- Returns:
- the functor of the compound term
-
getArity
public int getArity()
Returns the arity (the number of arguments) of the compound term.- Returns:
- the arity of the compound term
-
getArgs
public Object[] getArgs()
Returns the arguments of the compound term.- Returns:
- the arguments of the compound term
-
getArg
public Object getArg(int index)
Returns the index-th argument of the compound term. Numbering starts from 0.- Parameters:
index- the number of the required argument- Returns:
- the index-th argument of the compound term
-
-