Package ca.uqac.lif.cep.fol
Class PredicateTuple
- java.lang.Object
-
- ca.uqac.lif.cep.fol.PredicateTuple
-
public class PredicateTuple extends java.lang.ObjectAn assertion defining the truth value of a predicate for a concrete list of arguments.For example, the predicate tuple p(b,0) = TRUE stipulates that predicate p, when given the arguments "b" (a constant) and 0, returns the value TRUE.
-
-
Field Summary
Fields Modifier and Type Field Description protected Predicate.PredicateArgumentm_argumentsThe arguments of this predicate tupleprotected java.lang.Stringm_nameThe name of the predicate this tuple definesprotected booleanm_valueThe value associated to these arguments
-
Constructor Summary
Constructors Constructor Description PredicateTuple(java.lang.String name, boolean value, java.lang.Object[] arguments)Creates a new predicate tuple
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.ObjectgetArgument(int index)Retrieves the n-th argument of the tuplejava.lang.StringgetName()Gets the name of the predicate this tuple definesstatic PredicateTupletoPredicateTuple(java.lang.Object x)Creates a predicate tuple out of an object.java.lang.StringtoString()
-
-
-
Field Detail
-
m_arguments
protected Predicate.PredicateArgument m_arguments
The arguments of this predicate tuple
-
m_value
protected boolean m_value
The value associated to these arguments
-
m_name
protected java.lang.String m_name
The name of the predicate this tuple defines
-
-
Constructor Detail
-
PredicateTuple
public PredicateTuple(java.lang.String name, boolean value, java.lang.Object[] arguments)Creates a new predicate tuple- Parameters:
name- The name of the predicate this tuple definesvalue- The value associated to the argumentsarguments- The arguments of this predicate tuple
-
-
Method Detail
-
getName
public java.lang.String getName()
Gets the name of the predicate this tuple defines- Returns:
- The name
-
getArgument
public java.lang.Object getArgument(int index)
Retrieves the n-th argument of the tuple- Parameters:
index- The position to retrieve- Returns:
- The value, or
nullif index is out of bounds
-
toPredicateTuple
public static PredicateTuple toPredicateTuple(java.lang.Object x)
Creates a predicate tuple out of an object.- Parameters:
x- An array or an ordered collection of objects. Null elements and strings consisting only of whitespace, will be ignored when creating the tuple.- Returns:
- The tuple
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-