fipaos.skill.constraint.ccl.object
Class CSPSolution

java.lang.Object
  |
  +--fipaos.skill.constraint.ccl.object.CSPSolution

public class CSPSolution
extends java.lang.Object


This class represents as CSP-solution Object as described in the
"CCL Language Specification v2.01" section 4.1.1.2, p5.

This object captures the notion of a solution to a choice problem.
Here all the choices are assigned an appropriate value and the
assignment violates none of the posted constraints.


Field Summary
static int CONTENT
           
static java.lang.String CSPSOLUTION
          String used to reference a Content object representing a CSPSolution object
static java.lang.String CSPVARIABLEASSIGNMENT
          String used to reference a Content object representing a CSPVariableAssignment object.
static java.lang.String HREF
          
String used to reference the identifier of a CSPSolution object when represented
as an Attribute of a Content object.
static int LIST
           
static int LONG
           
static int STRING
           
 
Constructor Summary
CSPSolution()
          Constructs an empty CSPSolution
CSPSolution(Content content)
          Constructs a new CSPSolution and populates it with the Data in the passed Content object.
CSPSolution(java.lang.String name)
          
Constructs a CSPSolution with the given name.
 
Method Summary
 void addVariable(CSPVariableAssignment var)
          
Adds a new Variable Assignment to the CSPSolution
This represents another element in the solution.
 CSPSolution copy()
          Returns a copy of the CSPSolution object.
 void identify(java.lang.String str)
          
Identifies the CSPSolution.
 java.lang.String identity()
          
Returns the identifier for the CSPSolution.
static void main(java.lang.String[] args)
          Used for testing the class.
 Content toContent()
          Returns a Content object populated with the Data held in this CSPSolution object.
 java.lang.String toString()
          Returns a String representation of the CSPSolution.
 java.util.Vector variables()
          
Returns a Vector containing all the Variable Assignments that
represent the solution to the CSP problem.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CSPSOLUTION

public static final java.lang.String CSPSOLUTION
String used to reference a Content object representing a CSPSolution object

CSPVARIABLEASSIGNMENT

public static final java.lang.String CSPVARIABLEASSIGNMENT
String used to reference a Content object representing a CSPVariableAssignment object.

HREF

public static final java.lang.String HREF

String used to reference the identifier of a CSPSolution object when represented
as an Attribute of a Content object.

CONTENT

public static final int CONTENT

LIST

public static final int LIST

LONG

public static final int LONG

STRING

public static final int STRING
Constructor Detail

CSPSolution

public CSPSolution()
Constructs an empty CSPSolution

CSPSolution

public CSPSolution(java.lang.String name)

Constructs a CSPSolution with the given name.
This name refers to the CSP this is the solution for.

CSPSolution

public CSPSolution(Content content)
Constructs a new CSPSolution and populates it with the Data in the passed Content object.
Method Detail

identify

public void identify(java.lang.String str)

Identifies the CSPSolution.
This name refers to the CSP it is a solution for.

identity

public java.lang.String identity()

Returns the identifier for the CSPSolution.
This name refers to the CSP it is a solution for.

addVariable

public void addVariable(CSPVariableAssignment var)

Adds a new Variable Assignment to the CSPSolution
This represents another element in the solution.

variables

public java.util.Vector variables()

Returns a Vector containing all the Variable Assignments that
represent the solution to the CSP problem.

copy

public CSPSolution copy()
Returns a copy of the CSPSolution object.

toString

public java.lang.String toString()
Returns a String representation of the CSPSolution.
Overrides:
toString in class java.lang.Object

toContent

public Content toContent()
Returns a Content object populated with the Data held in this CSPSolution object.

main

public static void main(java.lang.String[] args)
Used for testing the class.