Package java.util

Examples of java.util.IdentityHashMap


    private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class,
                                                                       DefaultRefreshEventListener.class.getName());

  public void onRefresh(RefreshEvent event) throws HibernateException {
    onRefresh( event, new IdentityHashMap(10) );
  }
View Full Code Here


         * 1. SCXML elemnt (top) should reach count exactly 1. We essentially
         * summarize up the hierarchy tree starting with a given set of
         * states = active configuration.
         */
        boolean legalConfig = true; // let's be optimists
        Map counts = new IdentityHashMap();
        Set scxmlCount = new HashSet();
        for (Iterator i = states.iterator(); i.hasNext();) {
            TransitionTarget tt = (TransitionTarget) i.next();
            TransitionTarget parent = null;
            while ((parent = tt.getParent()) != null) {
                HashSet cnt = (HashSet) counts.get(parent);
                if (cnt == null) {
                    cnt = new HashSet();
                    counts.put(parent, cnt);
                }
                cnt.add(tt);
                tt = parent;
            }
            //top-level contribution
            scxmlCount.add(tt);
        }
        //Validate counts:
        for (Iterator i = counts.entrySet().iterator(); i.hasNext();) {
            Map.Entry entry = (Map.Entry) i.next();
            TransitionTarget tt = (TransitionTarget) entry.getKey();
            Set count = (Set) entry.getValue();
            if (tt instanceof Parallel) {
                Parallel p = (Parallel) tt;
                if (count.size() < p.getChildren().size()) {
                    errRep.onError(ErrorConstants.ILLEGAL_CONFIG,
                        "Not all AND states active for parallel "
                        + p.getId(), entry);
                    legalConfig = false;
                }
            } else {
                if (count.size() > 1) {
                    errRep.onError(ErrorConstants.ILLEGAL_CONFIG,
                        "Multiple OR states active for state "
                        + tt.getId(), entry);
                    legalConfig = false;
                }
            }
            count.clear(); //cleanup
        }
        if (scxmlCount.size() > 1) {
            errRep.onError(ErrorConstants.ILLEGAL_CONFIG,
                    "Multiple top-level OR states active!", scxmlCount);
        }
        //cleanup
        scxmlCount.clear();
        counts.clear();
        return legalConfig;
    }
View Full Code Here

    return null;
  }

  private void setPlaceholderData(ASTNode node, PlaceholderData data) {
    if (this.placeholderNodes == null) {
      this.placeholderNodes= new IdentityHashMap();
    }
    this.placeholderNodes.put(node, data);
  }
View Full Code Here

    this.content= content;
    this.lineInfo= lineInfo;
    this.nodeInfos= nodeInfos;
    this.tokenScanner= null;
    this.currentEdit= rootEdit;
    this.sourceCopyInfoToEdit= new IdentityHashMap();
    this.sourceCopyEndNodes= new Stack();

    this.formatter= new ASTRewriteFormatter(nodeInfos, eventStore, options, lineDelim);

    this.extendedSourceRangeComputer = extendedSourceRangeComputer;
View Full Code Here

          enclosingType, oldReturnType, false, true, true, x.isPrivate());

      // Setup all params and locals; map from the old method to the new method
      JParameter thisParam = program.createParameter(null,
          "this$static".toCharArray(), enclosingType, true, newMethod);
      Map/* <JVariable, JVariable> */varMap = new IdentityHashMap();
      for (int i = 0; i < x.params.size(); ++i) {
        JParameter oldVar = (JParameter) x.params.get(i);
        JParameter newVar = program.createParameter(oldVar.getSourceInfo(),
            oldVar.getName().toCharArray(), oldVar.getType(), oldVar.isFinal(),
            newMethod);
        varMap.put(oldVar, newVar);
      }
      newMethod.freezeParamTypes();

      // Copy all locals over to the new method
      for (int i = 0; i < x.locals.size(); ++i) {
        JLocal oldVar = (JLocal) x.locals.get(i);
        JLocal newVar = program.createLocal(oldVar.getSourceInfo(),
            oldVar.getName().toCharArray(), oldVar.getType(), oldVar.isFinal(),
            newMethod);
        varMap.put(oldVar, newVar);
      }
      x.locals.clear();

      // Move the body of the instance method to the static method
      newMethod.body.statements.addAll(x.body.statements);
View Full Code Here

    }

    private class EVLeafComparator implements Comparator {
        private Map<Object, Integer> origOrder;
        private EVLeafComparator(List<EVTask> origList) {
            origOrder = new IdentityHashMap();
            int pos = 0;
            for (EVTask t : origList)
                origOrder.put(t, pos++);
        }
View Full Code Here

     * And each time we recurse out of that layer, it is popped off the stack.
     */
    private LinkedList _currentLocation;

    public SerializerState() {
        _processedObjects = new IdentityHashMap();
        _currentLocation = new LinkedList();
        _fixups = new ArrayList<FixUp>();
    }
View Full Code Here

  /**
   * Returns a new non-threadsafe context map.
   */
  public static Map newContext() {
    return new IdentityHashMap();
  }
View Full Code Here

        void annotationDiscovered (String className, String annotationType);
    }

    public static Map<Annotation, AnnotatedElement> annotationsForClasses (Collection<String> classNames, Class[] types)
    {
        Map<Annotation, AnnotatedElement> annotationMap = new IdentityHashMap();
        for (String className : classNames) {
            annotationsForClassName(className, types, annotationMap);
        }
        return annotationMap;
    }
View Full Code Here

     * @param types the annotation classes to filter for
     * @return map from Annotation class to introspection Field, Method, or Class
     */
    public static Map<Annotation, AnnotatedElement> annotationsForClassName (String className, Class[] types)
    {
        Map<Annotation, AnnotatedElement> annotationMap = new IdentityHashMap();
        return annotationsForClassName(className, types, annotationMap);
    }
View Full Code Here

TOP

Related Classes of java.util.IdentityHashMap

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.