Package com.exigen.ie.constrainer.impl

Examples of com.exigen.ie.constrainer.impl.IntEvent


   * 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);
       }
     }

View Full Code Here


        if (_resource.caps().get(i).bound())
          _value++;

      _var.setMin(_value);

      IntEvent e = (IntEvent) event;

      IntEventEmployed ev = IntEventEmployed.getEvent(e);

      //notifyObservers(ev);
    }
View Full Code Here

TOP

Related Classes of com.exigen.ie.constrainer.impl.IntEvent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.