jpaul.Constraints.SetConstraints
Class CtDiffConstraint<T>

java.lang.Object
  extended by jpaul.Constraints.Constraint<SVar<T>,java.util.Set<T>>
      extended by jpaul.Constraints.SetConstraints.FilterConstraint<T>
          extended by jpaul.Constraints.SetConstraints.CtDiffConstraint<T>

public class CtDiffConstraint<T>
extends FilterConstraint<T>

CtDiffConstraint models a "difference with a constant set" constraint. Mathematically, such a constraint has the form:

vIn \ ctSet <= vDest
where /\ stands for set intersection, <= stands for set inclusion, vIn and vDest are set-valued variables, and ctSet is a constant set.

Version:
$Id: CtDiffConstraint.java,v 1.5 2006/03/14 02:29:30 salcianu Exp $
Author:
Alexandru Salcianu - salcianu@alum.mit.edu

Field Summary
 
Fields inherited from class jpaul.Constraints.SetConstraints.FilterConstraint
pred, vDest, vIn
 
Fields inherited from class jpaul.Constraints.Constraint
AVG_COST, HIGH_COST, LOW_COST, VERY_LOW_COST
 
Constructor Summary
CtDiffConstraint(SVar<T> vIn, java.util.Collection<T> ctSet, SVar<T> vDest)
          Creates a CtDiffConstraint with the meaning vIn \ ctSet <= vDest.
 
Method Summary
 boolean equals(java.lang.Object o)
           
 int hashCode()
           
 Constraint<SVar<T>,java.util.Set<T>> rewrite(UnionFind<SVar<T>> uf)
          We implemented rewrite(jpaul.DataStructs.UnionFind>), equals(java.lang.Object), and hashCode, such that constraints that are identical after variable unification are not duplicated needlessly.
 java.lang.String toString()
           
 
Methods inherited from class jpaul.Constraints.SetConstraints.FilterConstraint
action, cost, in, out
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CtDiffConstraint

public CtDiffConstraint(SVar<T> vIn,
                        java.util.Collection<T> ctSet,
                        SVar<T> vDest)
Creates a CtDiffConstraint with the meaning vIn \ ctSet <= vDest. This constructor does not construct a private copy of ctSet, so you may want to pass it an exclusive copy of ctSet.

Method Detail

rewrite

public Constraint<SVar<T>,java.util.Set<T>> rewrite(UnionFind<SVar<T>> uf)
We implemented rewrite(jpaul.DataStructs.UnionFind>), equals(java.lang.Object), and hashCode, such that constraints that are identical after variable unification are not duplicated needlessly.

Overrides:
rewrite in class Constraint<SVar<T>,java.util.Set<T>>
Parameters:
uf - Union-find structure; for each variable v, uf.find(v) is the representative of its equivalence class.

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class FilterConstraint<T>


Copyright 2005 Alexandru Salcianu - salcianu@alum.mit.edu