edu.cmu.cs.coral.icf.plan_based.planners
Class Literal

java.lang.Object
  |
  +--edu.cmu.cs.coral.icf.plan_based.planners.Literal

public class Literal
extends java.lang.Object
implements java.lang.Comparable

Represents a Literal used by a Planner. A Literal consists of a Predicate and a list of PlannerObject's representing the parameters. For example, in a blocksworld domain "(on block_a block_b)" might be a literal.

Since:
ICF 0.0
Version:
$Id$

Field Summary
private  PlannerObject[] params
          The values of the parameters of this Literal.
private  Predicate predicate
          The Predicate this Literal is based upon.
 
Constructor Summary
Literal(Predicate predicate)
          Constructs a new Literal based upon the given Predicate.
 
Method Summary
 int compareTo(java.lang.Object obj)
          Compares the passed Literal to this Literal
 boolean equals(java.lang.Object obj)
          Returns true if this Literal equals the object passed in, overrides Object.equals()
 PlannerObject getParam(int param_idx)
          Gets the value of one of the parameters of this Literal.
 Predicate getPredicate()
          Gets the predicate this Literal is based upon.
 int hashCode()
          Returns the hash code for this Literal.
 void setParam(int param_idx, PlannerObject object)
          Sets the value of one of the parameters of this Literal.
 
Methods inherited from class java.lang.Object
, clone, finalize, getClass, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

predicate

private Predicate predicate
The Predicate this Literal is based upon.
Since:
ICF 0.0

params

private PlannerObject[] params
The values of the parameters of this Literal.
Since:
ICF 0.0
Constructor Detail

Literal

public Literal(Predicate predicate)
Constructs a new Literal based upon the given Predicate.
Parameters:
predicate - the predicate this literal uses
Since:
ICF 0.0
Method Detail

compareTo

public int compareTo(java.lang.Object obj)
Compares the passed Literal to this Literal
Specified by:
compareTo in interface java.lang.Comparable
Parameters:
obj - the Literal to compare this one against
Returns:
-1 if thisobj
Since:
ICF 0.0

equals

public boolean equals(java.lang.Object obj)
Returns true if this Literal equals the object passed in, overrides Object.equals()
Parameters:
obj - the object to compare with
Returns:
true iff this Literal is equivalent to obj, i.e. the same predicate and parameters
Overrides:
equals in class java.lang.Object
Since:
ICF 0.0

hashCode

public int hashCode()
Returns the hash code for this Literal.
Returns:
the hash code for this Literal
Overrides:
hashCode in class java.lang.Object
Since:
ICF 0.0

getPredicate

public Predicate getPredicate()
Gets the predicate this Literal is based upon.
Returns:
the predicate this Literal uses
Since:
ICF 0.0

getParam

public PlannerObject getParam(int param_idx)
Gets the value of one of the parameters of this Literal.
Parameters:
param_idx - which parameter is desired
Returns:
the value of this parameter or null if the value has not been set
Since:
ICF 0.0

setParam

public void setParam(int param_idx,
                     PlannerObject object)
Sets the value of one of the parameters of this Literal.
Parameters:
param_idx - the index of the parameter to modify
object - the new value for this parameter
Since:
ICF 0.0