Package java.util

Examples of java.util.IdentityHashMap$ValueIterator


    Map map;
    synchronized (_suspended) {
      map = (Map)_suspended.get(desktop);
      if (map == null)
        _suspended.put(desktop, map = new IdentityHashMap(3));
          //note: we have to use IdentityHashMap because user might
          //use Integer or so as mutex
    }
    synchronized (map) {
      List list = (List)map.get(mutex);
View Full Code Here


    /**
     * Constructs a new, empty set; the backing <tt>IdentityHashMap</tt>
     * instance has default capacity (32).
     */
    public IdentityHashSet() {
    map = new IdentityHashMap();
  }
View Full Code Here

   *
   * @param c the collection whose elements are to be placed into this set.
   * @throws NullPointerException if the specified collection is null.
   */
  public IdentityHashSet(Collection c) {
    map = new IdentityHashMap(Math.max((c.size()*4)/3, 16));
    addAll(c);
  }
View Full Code Here

   *
     * @param expectedMaxSize the expected maximum size of the map.
     * @throws IllegalArgumentException if <tt>expectedMaxSize</tt> is negative
   */
  public IdentityHashSet(int expectedMaxSize) {
    map = new IdentityHashMap(expectedMaxSize);
  }
View Full Code Here

        // Read in size (number of Mappings)
        int size = s.readInt();

    // Read in IdentityHashMap capacity and load factor and create backing IdentityHashMap
    map = new IdentityHashMap((size*4)/3);
      // Allow for 33% growth (i.e., capacity is >= 2* size()).

    // Read in all elements in the proper order.
    for (int i=0; i<size; i++) {
      Object e = s.readObject();
View Full Code Here

   * @param initialCapacity the initial capacity of the Map
   * @return the new Map instance
   * @deprecated as of Spring 2.5, for usage on JDK 1.4 or higher
   */
  public static Map createIdentityMapIfPossible(int initialCapacity) {
    return new IdentityHashMap(initialCapacity);
  }
View Full Code Here

   * @param map trigger map to cull from
   * @param lpsToActivate set of LPs to be activated, added to by this call
   * @return culled Trigger map; should replace the map passed in
   */
  private IdentityHashMap cullTriggers(IdentityHashMap map, HashSet lpsToActivate) {
    IdentityHashMap stillWaiting = new IdentityHashMap();
    for (Iterator i = map.keySet().iterator(); i.hasNext(); ) {
      Trigger t = (Trigger)i.next();
      if (t.condition()) {
        ArrayList lps = (ArrayList)map.get(t);
        for (Iterator lpi = lps.iterator(); lpi.hasNext(); ) {
          LogicalProcess lp = (LogicalProcess)lpi.next();
          lp.setSelectedTrigger(t);
          lp.setTriggerOccurred(true);
        }
        t.action();
        if (!lps.isEmpty()) lpsToActivate.addAll(lps);
      }
      else {
        stillWaiting.put(t, map.get(t));
      }
    }
    return stillWaiting;
  }
View Full Code Here

    this.parent1 = parent1;
    this.parent2 = parent2;
  }

  protected IdentityHashMap compute() {
    IdentityHashMap partial = (IdentityHashMap)parent1.compute().clone();
    partial.putAll(parent2.compute());
    return partial;
  }
View Full Code Here

    this.parent = parent;
    this.filter = filter;
  }

  protected IdentityHashMap compute() {
    IdentityHashMap patrimony = parent.compute();
    IdentityHashMap partialDB = new IdentityHashMap();
    for (Iterator i = patrimony.keySet().iterator(); i.hasNext(); ) {
      Entity e = (Entity)i.next();
      if (!filter.passesFilter(e)) partialDB.put(e, null);
    }
    return partialDB;
  }
View Full Code Here

    this.parent = parent;
    this.filter = filter;
  }

  protected IdentityHashMap compute() {
    IdentityHashMap patrimony = parent.compute();
    IdentityHashMap partialDB = new IdentityHashMap();
    for (Iterator i = patrimony.keySet().iterator(); i.hasNext(); ) {
      Entity e = (Entity)i.next();
      if (filter.passesFilter(e)) partialDB.put(e, null);
    }
    return partialDB;
  }
View Full Code Here

TOP

Related Classes of java.util.IdentityHashMap$ValueIterator

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.