choco.util
Class BipartiteSet

java.lang.Object
  extended by choco.util.BipartiteSet

public class BipartiteSet
extends java.lang.Object

Implements a bipartite set.

Cette classe est utilisee pour stocker les evenements de propagation de contrainte : les elements de gauche sont a propages, les autres ne doivent pas etre propages.


Constructor Summary
BipartiteSet()
          Constructs a new bipartite set.
 
Method Summary
 void addLeft(java.lang.Object object)
          Adds an object to the left part of the set.
 void addRight(java.lang.Object object)
          Adds an object to the right part of the set.
 int getNbLeft()
          Returns the number of elements in the left part.
 int getNbObjects()
          Returns the number of objects in the set.
 int getNbRight()
          Returns the number of elements in the right part.
 boolean isIn(java.lang.Object object)
          Checks if the object is in the set.
 boolean isLeft(java.lang.Object object)
          Checks if the object is in the left part of the set.
 java.util.Iterator leftIterator()
          Iterator without a valid remove method !
 void moveAllLeft()
          Moves all the objects to the left part.
 void moveAllRight()
          Moves all the objects to the right part.
 java.lang.Object moveLastLeft()
          Move the last element in the left part to the right part.
 void moveLeft(java.lang.Object object)
          Moves the object the left part of the set if needed.
 void moveRight(java.lang.Object object)
          Moves the object the right part of the set if needed.
 java.util.Iterator rightIterator()
          Iterator without a valid remove method !
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BipartiteSet

public BipartiteSet()
Constructs a new bipartite set. Initialized internal util.

Method Detail

moveLeft

public void moveLeft(java.lang.Object object)
Moves the object the left part of the set if needed.


moveRight

public void moveRight(java.lang.Object object)
Moves the object the right part of the set if needed.


moveAllLeft

public void moveAllLeft()
Moves all the objects to the left part.


moveAllRight

public void moveAllRight()
Moves all the objects to the right part.


addRight

public void addRight(java.lang.Object object)
Adds an object to the right part of the set.


addLeft

public void addLeft(java.lang.Object object)
Adds an object to the left part of the set.


isLeft

public boolean isLeft(java.lang.Object object)
Checks if the object is in the left part of the set.


isIn

public boolean isIn(java.lang.Object object)
Checks if the object is in the set.


getNbLeft

public int getNbLeft()
Returns the number of elements in the left part.


getNbRight

public int getNbRight()
Returns the number of elements in the right part.


getNbObjects

public int getNbObjects()
Returns the number of objects in the set.


moveLastLeft

public java.lang.Object moveLastLeft()
Move the last element in the left part to the right part.

Returns:
The moved element.

leftIterator

public java.util.Iterator leftIterator()
Iterator without a valid remove method ! Warning : suppose the set is not modified suring iterating !


rightIterator

public java.util.Iterator rightIterator()
Iterator without a valid remove method ! Warning : suppose the set is not modified suring iterating !