public class BooleanVariable extends Object implements Comparable<BooleanVariable>
CSP
Constructor and Description |
---|
BooleanVariable() |
BooleanVariable(String name)
Adds a new boolean variable with give name.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(BooleanVariable v) |
void |
decode(BitSet satValues) |
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.
|
boolean |
isDominant() |
void |
setCode(int code)
Sets the code value in the encoded representation.
|
void |
setComment(String comment)
Sets the comment to the boolean variable.
|
void |
setDominant(boolean dominant) |
void |
setValue(boolean value)
Sets the value of the boolean variable.
|
String |
toString()
Returns the string representation of the boolean variable.
|
public BooleanVariable(String name) throws SugarException
name
- the name of the boolean variableSugarException
- when the name is duplicatedpublic BooleanVariable() throws SugarException
SugarException
public String getName()
public boolean isAux()
public String getComment()
public void setComment(String comment)
comment
- the comment to setpublic int getCode()
public void setCode(int code)
code
- the code valuepublic boolean isDominant()
public void setDominant(boolean dominant)
public boolean getValue()
public void setValue(boolean value)
value
- the value to setpublic int getSatVariablesSize()
public void decode(BitSet satValues)
public int compareTo(BooleanVariable v)
compareTo
in interface Comparable<BooleanVariable>