Package ca.uqac.lif.cep.fol
Class PredicateTuple
- java.lang.Object
-
- ca.uqac.lif.cep.fol.PredicateTuple
-
public class PredicateTuple extends java.lang.Object
An 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.PredicateArgument
m_arguments
The arguments of this predicate tupleprotected java.lang.String
m_name
The name of the predicate this tuple definesprotected boolean
m_value
The 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.Object
getArgument(int index)
Retrieves the n-th argument of the tuplejava.lang.String
getName()
Gets the name of the predicate this tuple definesstatic PredicateTuple
toPredicateTuple(java.lang.Object x)
Creates a predicate tuple out of an object.java.lang.String
toString()
-
-
-
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
null
if 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:
toString
in classjava.lang.Object
-
-