Package java.util

Examples of java.util.TreeMap


      logger.error("[execute] Exception thrown.", e);
      throw new ServletException(e);
    }
    // Only 8 custom fields fit on the detail screen so we have to pull only the
    // first 8 out.
    TreeMap customFieldMap = customField.getCustomFieldData("Entity");
    Collection customFieldValues = customFieldMap.values();
    int arraySize = customFieldValues.size() > 4 ? 4 : customFieldValues.size();
    CustomFieldVO[] fieldArray = new CustomFieldVO[arraySize];
    Iterator i = customFieldValues.iterator();
    int count = 0;
    while (i.hasNext() && count < 4) {
View Full Code Here


      logger.error("[execute] Exception thrown.", e);
      throw new ServletException(e);
    }
    // Only 8 custom fields fit on the detail screen so we have to pull only the
    // first 8 out.
    TreeMap customFieldMap = customField.getCustomFieldData("Individual", individualVO
        .getContactID());
    Collection customFieldValues = customFieldMap.values();
    int arraySize = customFieldValues.size() > 8 ? 8 : customFieldValues.size();
    CustomFieldVO[] fieldArray = new CustomFieldVO[arraySize];
    Iterator i = customFieldValues.iterator();
    int count = 0;
    while (i.hasNext() && count < 8) {
View Full Code Here

      logger.error("[execute] Exception thrown.", e);
      throw new ServletException(e);
    }
    // Only 8 custom fields fit on the detail screen so we have to pull only the
    // first 8 out.
    TreeMap customFieldMap = customField.getCustomFieldData("Individual");
    Collection customFieldValues = customFieldMap.values();
    int arraySize = customFieldValues.size() > 8 ? 8 : customFieldValues.size();
    CustomFieldVO[] fieldArray = new CustomFieldVO[arraySize];
    Iterator i = customFieldValues.iterator();
    int count = 0;
    while (i.hasNext() && count < 8) {
View Full Code Here

      logger.error("[execute] Exception thrown.", e);
      throw new ServletException(e);
    }
    // Only 8 custom fields fit on the detail screen so we have to pull only the
    // first 8 out.
    TreeMap customFieldMap = customField.getCustomFieldData("Entity", entityVO.getContactID());
    Collection customFieldValues = customFieldMap.values();
    int arraySize = customFieldValues.size() > 4 ? 4 : customFieldValues.size();
    CustomFieldVO[] fieldArray = new CustomFieldVO[arraySize];
    Iterator i = customFieldValues.iterator();
    int count = 0;
    while (i.hasNext() && count < 4) {
View Full Code Here

  
        synchronized( handed_out ){
       
          Iterator  it = handed_out.values().iterator();
         
          Map  cap_map    = new TreeMap();
          Map  alloc_map  = new TreeMap();
         
          while( it.hasNext()){
           
            DirectByteBuffer  db = (DirectByteBuffer)it.next();
           
            if ( verbose ){
              String  trace = db.getTraceString();
             
              if ( trace != null ){
               
                System.out.println( trace );
              }
            }
           
            Integer cap   = new Integer( db.getBufferInternal().capacity());
            Byte  alloc   = new Byte( db.getAllocator());
           
            myInteger  c = (myInteger)cap_map.get(cap);
           
            if ( c == null ){
             
              c  = new myInteger();
             
              cap_map.put( cap, c );
            }
           
            c.value++;
           
          myInteger  a = (myInteger)alloc_map.get(alloc);
           
            if ( a == null ){
             
              a  = new myInteger();
             
              alloc_map.put( alloc, a );
            }
           
            a.value++;       
          }
         
          it = cap_map.keySet().iterator();
         
          while( it.hasNext()){
           
            Integer    key   = (Integer)it.next();
            myInteger  count   = (myInteger)cap_map.get( key );
           
                if( key.intValue() < 1024 ){
                 
                  System.out.print("[" +key.intValue()+ " x " +count.value+ "] ");
                 
                }else
                 
                  System.out.print("[" +key.intValue()/1024+ "K x " +count.value+ "] ");
                }
          }
         
          System.out.println();
         
        it = alloc_map.keySet().iterator();
         
          while( it.hasNext()){
           
            Byte    key   = (Byte)it.next();
            myInteger  count   = (myInteger)alloc_map.get( key );
           
                System.out.print("[" + DirectByteBuffer.AL_DESCS[key.intValue()]+ " x " +count.value+ "] ");
          }
         
          if ( cm != null ){
View Full Code Here

        return (String)this.attributes.get(key);
    }

    public void addAttribute(String key, String value) {
        if (attributes == null) {
            this.attributes = new TreeMap(ATTRIBUTE_COMPARATOR);
        }
        this.attributes.put(key, value);
    }
View Full Code Here

    System.out.println("[KnowledgeFlow] Initializing KF...");

    try {
      TOOLBARS = new Vector();

      TreeMap wrapList = new TreeMap();
      Properties GEOProps = GenericPropertiesCreator.getGlobalOutputProperties();

      if (GEOProps == null) {
        GenericPropertiesCreator creator = new GenericPropertiesCreator();


        if (creator.useDynamic()) {
          creator.execute(false);
          /* now process the keys in the GenericObjectEditor.props. For each
           key that has an entry in the Beans.props associating it with a
           bean component a button tool bar will be created */
          GEOProps = creator.getOutputProperties();
        } else {
          // Read the static information from the GenericObjectEditor.props
          GEOProps = Utils.readProperties("weka/gui/GenericObjectEditor.props");
        }
      }
      Enumeration en = GEOProps.propertyNames();
      while (en.hasMoreElements()) {
        String geoKey = (String)en.nextElement();
        //  System.err.println("GEOKey " + geoKey);

        // try to match this key with one in the Beans.props file
        String beanCompName = BEAN_PROPERTIES.getProperty(geoKey);
        if (beanCompName != null) {
          // add details necessary to construct a button bar for this class
          // of algorithms
          Vector newV = new Vector();
          // check for a naming alias for this toolbar
          String toolBarNameAlias =
            BEAN_PROPERTIES.getProperty(geoKey+".alias");
          String toolBarName = (toolBarNameAlias != null) ?
              toolBarNameAlias :
                geoKey.substring(geoKey.lastIndexOf('.')+1, geoKey.length());

          // look for toolbar ordering information for this wrapper type
          String order =
            BEAN_PROPERTIES.getProperty(geoKey+".order");
          Integer intOrder = (order != null) ?
              new Integer(order) :
                new Integer(0);

              // Name for the toolbar (name of weka algorithm class)
              newV.addElement(toolBarName);
              // Name of bean capable of handling this class of algorithm
              newV.addElement(beanCompName);

              // add the root package for this key
              String rootPackage = geoKey.substring(0, geoKey.lastIndexOf('.'));

              newV.addElement(rootPackage);

              // All the weka algorithms of this class of algorithm
              String wekaAlgs = GEOProps.getProperty(geoKey);

              Hashtable roots = GenericObjectEditor.sortClassesByRoot(wekaAlgs);
              Hashtable hpps = new Hashtable();
              Enumeration enm = roots.keys();
              while (enm.hasMoreElements()) {
                String root = (String) enm.nextElement();
                String classes = (String) roots.get(root);
                weka.gui.HierarchyPropertyParser hpp =
                  new weka.gui.HierarchyPropertyParser();
                hpp.build(classes, ", ");
                //            System.err.println(hpp.showTree());
                hpps.put(root, hpp);
              }

              //------ test the HierarchyPropertyParser
              /*  weka.gui.HierarchyPropertyParser hpp =
      new weka.gui.HierarchyPropertyParser();
    hpp.build(wekaAlgs, ", ");

    System.err.println(hpp.showTree()); */
              // ----- end test the HierarchyPropertyParser
              //    newV.addElement(hpp); // add the hierarchical property parser
              newV.addElement(hpps); // add the hierarchical property parser

              StringTokenizer st = new StringTokenizer(wekaAlgs, ", ");
              while (st.hasMoreTokens()) {
                String current = st.nextToken().trim();
                newV.addElement(current);
              }
              wrapList.put(intOrder, newV);
              //    TOOLBARS.addElement(newV);
        }
      }
      Iterator keysetIt = wrapList.keySet().iterator();
      while (keysetIt.hasNext()) {
        Integer key = (Integer)keysetIt.next();
        Vector newV = (Vector)wrapList.get(key);
        if (newV != null) {
          TOOLBARS.addElement(newV);
        }
      }
    } catch (Exception ex) {
View Full Code Here

        //
        // create a list of webapp classloaders
        // this will help us to associate threads with applications.
        //
        List contexts = getContainerWrapper().getTomcatContainer().findContexts();
        Map classLoaderMap = new TreeMap();
        for (int i = 0; i < contexts.size(); i++) {
            Context context = (Context) contexts.get(i);
            if (context.getLoader() != null && context.getLoader().getClassLoader() != null) {
                classLoaderMap.put(toUID(context.getLoader().getClassLoader()), context.getName());
            }
        }

        return new ModelAndView(getViewName(), "threads", enumerateThreads(classLoaderMap));
    }
View Full Code Here

        bikes.add("specialized");
        bikes.add("kona");
        bikes.add("GT");
        session.put("bikes", bikes);

        Map bikeParts = new TreeMap();
        bikeParts.put("bikes", bikes);
        session.put("parts", bikeParts);

        System.out.println(Instruments.sizeOf(session));

    }
View Full Code Here

  }


  private void insertSecurityProfile(int securityProfileId, ModuleFieldRightMatrix mfrx, CVDal cvdl)
  {
    TreeMap moduleRight = mfrx.getModuleRights();
    Set moduleIds = moduleRight.keySet();
    Iterator it = moduleIds.iterator();
    int right;
    while (it.hasNext())
    {
      Integer moduleId = (Integer)it.next();
      HashMap moduleInfo = (HashMap)moduleRight.get(moduleId);
      Integer rightInteger = (Integer)moduleInfo.get("rights");
      String moduleName = (String)moduleInfo.get("name");
      if (rightInteger == null)
      { // if there isn't a rights value there is no record to insert
        continue;
View Full Code Here

TOP

Related Classes of java.util.TreeMap

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.