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 boolean
equals(Object obj)
Object
getArg(int index)
Returns the index-th argument of the compound term.Object[]
getArgs()
Returns the arguments of the compound term.int
getArity()
Returns the arity (the number of arguments) of the compound term.String
getFunctor()
Returns the functor of the compound term.int
hashCode()
String
toString()
-
-
-
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
-
-