* Overrides the appropriate method of {@link Observer} class
*/
public void update(Subject subject, EventOfInterest event)
throws Failure
{
IntEvent e = (IntEvent) event;
// System.out.println("Update event: " + e);
// System.out.println("++++ " + this);
IntExp[] cards = _cards.data();
int var_index = this.getIndex(e.exp());
int type = e.type();
int max = e.max();
int min = e.min();
if ((type & EventOfInterestConstants.MIN) != 0)
{
int oldmin = e.oldmin();
for(int i = oldmin; i < min; ++i)
{
((IntExpCard)cards[i - _min]).removeIndex(var_index);
}
}
if ((type & EventOfInterestConstants.MAX) != 0)
{
int oldmax = e.oldmax();
for(int i = oldmax; i > max; --i)
{
((IntExpCard)cards[i - _min]).removeIndex(var_index);
}
}
if ((type & EventOfInterestConstants.REMOVE) != 0)
{
int nRemoves = e.numberOfRemoves();
for(int i = 0 ; i < nRemoves; ++i)
{
int removed = e.removed(i);
if (min < removed && removed < max )
((IntExpCard)cards[removed - _min]).removeIndex(var_index);
}
}