Package java.util

Examples of java.util.TreeSet


            iList.remove(oldest);
            return oldest.getObject();
        }
       
        public String toString() {
            return new TreeSet(iList).toString();
        }
View Full Code Here


  {
    HashMap hmap = new HashMap();

    Stack stack = getTableTrack(target, source);

    Set tableSet = new TreeSet();
   
    String pop1 = "";
    String pop2 = "";   
    pop1 = (String)stack.pop();
    tableSet.add(pop1);
    String searchClause = " ";
   
    while(!stack.empty())
    {
      pop2 = (String)stack.pop();     
      tableSet.add(pop1);
      tableSet.add(pop2);     
      Vector vec = (Vector) ((HashMap)this.get(pop2)).get(pop1);

      String clause = "";
      String othTableNames = "";

      if (vec.size() == 1)
      {
          TableRelate tr = (TableRelate)vec.get(0);
         
          clause      = tr.getCaluse();
          String othName = tr.getOthertablename();
          if(othName == null)
            othName = "";
          othTableNames =  othName;     
      }
      else
      {
        clause = clause + " AND (  ";
        for (int i = 0;i<vec.size();i++)
        {
          TableRelate tr = (TableRelate)vec.get(i);
         
          if(i > 0)
            clause      = clause + " OR ( 1 = 1 "+ tr.getCaluse() + " ) ";
          else
            clause      = clause + " ( 1 = 1 "+ tr.getCaluse() + " ) ";                   
           
          String othName = tr.getOthertablename();
          if(othName == null)
            othName = "";

          if( !((othTableNames.trim()).equals("")))
          othTableNames = othTableNames +" , "+ othName;
           
        }
        clause = clause + " ) ";
      }
      StringTokenizer parse = new StringTokenizer(othTableNames, ",");

      while (parse.hasMoreTokens ())
      {
         tableSet.add(parse.nextToken().toString());
      }
 
     
      searchClause = searchClause +" "+clause;
      pop1 = pop2;     
View Full Code Here

        // cpu cycles we will have to waste.

        // Get all the appropriate field lists and stick them on the formbean
        // The fieldList (ArrayList of LabelValueBean) will be stored in a
        // HashMap with the key being the (Number)tableId
        TreeSet keySet = new TreeSet(tableMap.keySet());
        Iterator keyIterator = keySet.iterator();
        allFields = new HashMap();
        while (keyIterator.hasNext()) {
          Number key = (Number)keyIterator.next();
          // iterate the tables and get all the field lists
          // stick them in a hashmap of arraylists on the form bean.
View Full Code Here

      reportForm.set("conditionList", conditionList);

      // Get all the appropriate field lists and stick them on the formbean
      // The fieldList (ArrayList of LabelValueBean) will be stored in a
      // HashMap with the key being the (Number)tableId
      TreeSet keySet = new TreeSet(tableMap.keySet());
      Iterator keyIterator = keySet.iterator();
      allFields = new HashMap();
      while (keyIterator.hasNext()) {
        Number key = (Number)keyIterator.next();
        // iterate the tables and get all the field lists
        // stick them in a hashmap of arraylists on the form bean.
View Full Code Here

      ArrayList tableList = AdvancedSearchUtil.buildSelectOptionList(tableMap);
      ArrayList conditionList = AdvancedSearchUtil.buildSelectOptionList(conditionMap);
      // Get all the appropriate field lists and stick them on the formbean
      // The fieldList (ArrayList of LabelValueBean) will be stored in a
      // HashMap with the key being the (Number)tableId
      TreeSet keySet = new TreeSet(tableMap.keySet());
      Iterator keyIterator = keySet.iterator();
      allFields = new HashMap();
      while (keyIterator.hasNext()) {
        Number key = (Number)keyIterator.next();
        // iterate the tables and get all the field lists
        // stick them in a hashmap of arraylists on the form bean.
View Full Code Here

   * HashMap.
   */
  private ArrayList buildSelectOptionList(HashMap map)
  {
    ArrayList optionList = new ArrayList();
    TreeSet keySet = new TreeSet(map.keySet());
    Iterator keyIterator = keySet.iterator();
    // prepend an empty 0 label to the top of each OptionList
    optionList.add(new LabelValueBean("-- Select --", "0"));
    while(keyIterator.hasNext())
    {
      Number key = (Number)keyIterator.next();
View Full Code Here

        init();
    }

    public void init() {
        if (eventA != null && eventB != null) {
            commonPersons = new TreeSet(new PersonComparator());
            commonPersons.addAll(eventA.getPersons());
            commonPersons.retainAll(eventB.getPersons());
        }
    }
View Full Code Here

        /**
         * Constructs a new <CODE>PdfBody</CODE>.
         * @param writer
         */
        PdfBody(PdfWriter writer) {
            xrefs = new TreeSet();
            xrefs.add(new PdfCrossReference(0, 0, 65535));
            position = writer.getOs().getCounter();
            refnum = 1;
            this.writer = writer;
        }
View Full Code Here

   
    if (subcmd.equals("list") || subcmd.equals("listall")) {
      boolean all_plugins = subcmd.equals("listall");
      ci.out.println("> -----");
      PluginInterface[] plugins = ci.getCore().getPluginManager().getPluginInterfaces();
      TreeSet plugin_ids = new TreeSet(String.CASE_INSENSITIVE_ORDER);
      for (int i=0; i<plugins.length; i++) {
        if (!all_plugins && !plugins[i].getPluginState().isOperational()) {continue;}
        String plugin_id = plugins[i].getPluginID();
        plugin_ids.add(plugin_id);
      }
      TextWrap.printList(plugin_ids.iterator(), ci.out, "   ");
      ci.out.println("> -----");
      return;
    }
   
    if (subcmd.equals("location")) {
View Full Code Here

    Map backmap = new HashMap();
    for (Iterator iter = ExternalUIConst.parameterlegacy.entrySet().iterator(); iter.hasNext();) {
      Map.Entry entry = (Map.Entry) iter.next();
      backmap.put( entry.getValue(), entry.getKey() );
    }
    TreeSet srt = new TreeSet();
    while (I.hasNext()) {
      String internal_name = (String) I.next();
     
      String  external_name = (String) backmap.get(internal_name);
     
      if ( external_name == null ){
       
        external_name = internal_name;
      }
      if( sp.matches(external_name) )
      {
        Parameter param = Parameter.get( internal_name, external_name );
       
        if ( non_defaults ){
         
          if ( !param.isDefault()){
           
            srt.add( param.getString( true ));
          }
        }else{
         
          srt.add( param.getString( false ));
        }
      }
    }
    I = srt.iterator();
    while (I.hasNext()) {
      out.println((String) I.next());
    }
  }
View Full Code Here

TOP

Related Classes of java.util.TreeSet

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.