choco.kernel.model.constraints.cnf
Class Singleton

java.lang.Object
  extended by choco.kernel.model.constraints.cnf.ALogicTree
      extended by choco.kernel.model.constraints.cnf.Singleton
All Implemented Interfaces:
Cloneable

public class Singleton
extends ALogicTree


Since:
21/12/10
Author:
Charles Prud'homme

Nested Class Summary
 
Nested classes/interfaces inherited from class choco.kernel.model.constraints.cnf.ALogicTree
ALogicTree.Operator, ALogicTree.Type
 
Field Summary
static Singleton FALSE
           
static Singleton TRUE
           
 
Constructor Summary
protected Singleton(ALogicTree.Type type)
           
 
Method Summary
 IntegerVariable[] flattenBoolVar()
          Extracts and returns the flatten array of BoolVar contained in this.
 ALogicTree[] getChildren()
          Returns the array of children of this.
 int getNbPositiveLiterals()
          Computes and returns the number of positive literals contained in the direct level.
 boolean is(ALogicTree.Operator op)
          Current tree is rooted with the logical operator op
 String toString()
           
 
Methods inherited from class choco.kernel.model.constraints.cnf.ALogicTree
clone
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TRUE

public static final Singleton TRUE

FALSE

public static final Singleton FALSE
Constructor Detail

Singleton

protected Singleton(ALogicTree.Type type)
Method Detail

is

public boolean is(ALogicTree.Operator op)
Description copied from class: ALogicTree
Current tree is rooted with the logical operator op

Specified by:
is in class ALogicTree
Parameters:
op - operator checked
Returns:
true if this is op

getChildren

public ALogicTree[] getChildren()
Description copied from class: ALogicTree
Returns the array of children of this. null is a valid return value.

Specified by:
getChildren in class ALogicTree
Returns:
an array of logic trees, null otherwise

flattenBoolVar

public IntegerVariable[] flattenBoolVar()
Description copied from class: ALogicTree
Extracts and returns the flatten array of BoolVar contained in this. WARNING : a variable may appear more than once, redundancy is not checked!

Specified by:
flattenBoolVar in class ALogicTree
Returns:
array of bool variables

toString

public String toString()
Overrides:
toString in class Object

getNbPositiveLiterals

public int getNbPositiveLiterals()
Description copied from class: ALogicTree
Computes and returns the number of positive literals contained in the direct level.

Specified by:
getNbPositiveLiterals in class ALogicTree
Returns:
number of positive literals


Copyright © 2012. All Rights Reserved.