Sugar version 1.13 Core API Specification

jp.ac.kobe_u.cs.sugar.csp
Class BooleanVariable

java.lang.Object
  extended by jp.ac.kobe_u.cs.sugar.csp.BooleanVariable
All Implemented Interfaces:
Comparable<BooleanVariable>

public class BooleanVariable
extends Object
implements Comparable<BooleanVariable>

This class implements a boolean variable of CSP.

See Also:
CSP

Constructor Summary
BooleanVariable()
           
BooleanVariable(String name)
          Adds a new boolean variable with give name.
 
Method Summary
 int compareTo(BooleanVariable v)
           
 void decode(BitSet satValues)
           
 void encode(Encoder encoder)
           
 boolean equals(Object obj)
           
 int getCode()
          Returns the code value in the encoded representation.
 String getComment()
          Returns the comment set to the boolean variable.
 String getName()
          Returns the name of the boolean variable.
 int getSatVariablesSize()
           
 boolean getValue()
          Returns the value of the boolean variable.
 int hashCode()
           
 boolean isAux()
          Returns true when the boolean variable is aux.
 void setCode(int code)
          Sets the code value in the encoded representation.
 void setComment(String comment)
          Sets the comment to the boolean variable.
 void setValue(boolean value)
          Sets the value of the boolean variable.
 String toString()
          Returns the string representation of the boolean variable.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BooleanVariable

public BooleanVariable(String name)
                throws SugarException
Adds a new boolean variable with give name.

Parameters:
name - the name of the boolean variable
Throws:
SugarException - when the name is duplicated

BooleanVariable

public BooleanVariable()
                throws SugarException
Throws:
SugarException
Method Detail

getName

public String getName()
Returns the name of the boolean variable.

Returns:
the name

isAux

public boolean isAux()
Returns true when the boolean variable is aux.

Returns:
true when the boolean variable is aux

getComment

public String getComment()
Returns the comment set to the boolean variable.

Returns:
the comment

setComment

public void setComment(String comment)
Sets the comment to the boolean variable.

Parameters:
comment - the comment to set

getCode

public int getCode()
Returns the code value in the encoded representation.

Returns:
the code value in the encoded representation

setCode

public void setCode(int code)
Sets the code value in the encoded representation.

Parameters:
code - the code value

getValue

public boolean getValue()
Returns the value of the boolean variable.

Returns:
the value

setValue

public void setValue(boolean value)
Sets the value of the boolean variable.

Parameters:
value - the value to set

getSatVariablesSize

public int getSatVariablesSize()

encode

public void encode(Encoder encoder)

decode

public void decode(BitSet satValues)

compareTo

public int compareTo(BooleanVariable v)
Specified by:
compareTo in interface Comparable<BooleanVariable>

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

toString

public String toString()
Returns the string representation of the boolean variable.

Overrides:
toString in class Object
Returns:
the string representation

Sugar version 1.13 Core API Specification

Sugar: A SAT-based Constraint Solver