org.opt4j.satdecoding
Class Literal

java.lang.Object
  extended by org.opt4j.satdecoding.Literal

public class Literal
extends java.lang.Object

A Literal is a data structure that represents a variable and its phase.


Constructor Summary
Literal(java.lang.Object variable, boolean phase)
          Constructs a Literal with a variable and their phase.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Compares the specified Object with this for equality.
 int hashCode()
          Returns a hash code value for this Literal.
 Literal negate()
          Returns the negated Literal.
 boolean phase()
          Returns the phase of this Literal.
 java.lang.String toString()
          Returns a String representation of this Literal.
 java.lang.Object variable()
          Returns the variable of this Literal.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Literal

public Literal(java.lang.Object variable,
               boolean phase)
Constructs a Literal with a variable and their phase.

Parameters:
variable - the variable
phase - the phase (true means not negated)
Method Detail

variable

public java.lang.Object variable()
Returns the variable of this Literal.

Returns:
the variable of this literal

phase

public boolean phase()
Returns the phase of this Literal.

Returns:
true if the literal is not negated, false if the literal is negated

negate

public Literal negate()
Returns the negated Literal.

Returns:
the negated literal

hashCode

public int hashCode()
Returns a hash code value for this Literal.

Overrides:
hashCode in class java.lang.Object
Returns:
a hash code value for this literal

equals

public boolean equals(java.lang.Object obj)
Compares the specified Object with this for equality. Returns true if the objects are equal and false if they are not equal, respectively.

Overrides:
equals in class java.lang.Object
Parameters:
obj - the reference object with which to compare
Returns:
true if the objects are equal and false if they are not equal

toString

public java.lang.String toString()
Returns a String representation of this Literal.

Overrides:
toString in class java.lang.Object
Returns:
a string representation of this literal