Package java.util

Examples of java.util.TreeMap


         // Access cached xsl transformation
         XslTransformer xslContentTransformer = null;
         if (this.xslContentTransformerFileName != null) {
            xslContentTransformer = (XslTransformer)query.getTransformer();
            if (xslContentTransformer == null) {
               Map xslProps = new TreeMap(); // TODO: Where to get them from
               xslContentTransformer = new XslTransformer(glob, this.xslContentTransformerFileName, null, null, xslProps);
            }
         }
        
         String xml = getXml(msgUnit).trim(); // Content or QoS
View Full Code Here


      this.status = WAITING;
      this.statement = statement;
      this.replicationPrefix = replicationPrefix;
      this.requestId = requestId;
      this.me = "SqlStatement-" + this.replicationPrefix + "-" + this.requestId;
      this.slaves = new TreeMap();
      for (int i=0; i < slaveList.size(); i++)
         this.slaves.put(slaveList.get(i), "");
      this.referenceResponse = "";
      this.received = new ArrayList();
      this.failed = new ArrayList();
View Full Code Here

            catalog = getIdentifier(catalog.trim());
         if (schema != null)
            schema = getIdentifier(schema.trim());
         if (table != null)
            table = getIdentifier(table.trim());
         TreeMap map = new TreeMap();
         rs = meta.getColumns(catalog, schema, table, null);
         while (rs.next()) {
            int pos = rs.getInt("ORDINAL_POSITION");
            String name = rs.getString("COLUMN_NAME");
            // should already be in the correct order according to
            // javadoc but to be really sure we order it too
            map.put(new Integer(pos), name);
            count++;
         }
         if (count != map.size())
            throw new Exception("Probably multiple tables '" + table + "' found since more columns with same ordinal position found");
         return (String[])map.values().toArray(new String[map.size()]);
      }
      finally {
         try {
            if (rs != null)
               rs.close();
View Full Code Here

      meat.setDurable(isPersistent());
      meat.setId(uniqueId);
      meat.setKey(key);
      meat.setQos(qos);
      meat.setRefCount(1);
      Map m = new TreeMap();
      m.put(XBMeat.SESSION_NAME, getSessionName());
      meat.setMetaInfo(StringPairTokenizer.mapToCSV(m));
      return meat;
   }
View Full Code Here

      synchronized (info) {
        
         InfoHelper helper = new InfoHelper(info);
        
         Iterator iter = info.getKeys().iterator();
         TreeMap map = new TreeMap();
         while (iter.hasNext()) {
            String key = ((String)iter.next()).trim();
            if (prefix == null || key.startsWith(prefix)) {
               String val = info.get(key, null);
               if (prefix != null)
                  key = key.substring(prefix.length());
               if (dbHelper != null) {
                  key = dbHelper.getIdentifier(key);
                  val = dbHelper.getIdentifier(val);
               }
               log.fine("found and adding key='" + key + "' value='" + val + "' on map for prefix='" + prefix + "'");
               if (newPrefix != null)
                  map.put(newPrefix + key, val);
               else
                  map.put(key, val);
            }
         }
         return map;
      }
   }
View Full Code Here

    * postfix. The returned keys are returned in alphabetical order.
    */
   public static Map getPropertiesEndingWith(String postfix, I_Info info, DbMetaHelper dbHelper, String newPostfix) {
      synchronized (info) {
         Iterator iter = info.getKeys().iterator();
         TreeMap map = new TreeMap();
         while (iter.hasNext()) {
            String key = ((String)iter.next()).trim();
            if (postfix == null || key.endsWith(postfix)) {
               String val = info.get(key, null);
               if (postfix != null)
                  key = key.substring(0, key.length() - postfix.length());
               if (dbHelper != null) {
                  key = dbHelper.getIdentifier(key);
                  val = dbHelper.getIdentifier(val);
               }
               log.fine("found and adding key='" + key + "' value='" + val + "' on map for postfix='" + postfix + "'");
               if (newPostfix != null)
                  map.put(key + newPostfix, val);
               else
                  map.put(key, val);
            }
         }
         return map;
      }
   }
View Full Code Here

    * prefix. The returned keys are returned in alphabetical order.
    */
   public static Map getObjectsWithKeyStartingWith(String prefix, I_Info info, DbMetaHelper dbHelper) {
      synchronized (info) {
         Iterator iter = info.getObjectKeys().iterator();
         TreeMap map = new TreeMap();
         while (iter.hasNext()) {
            String key = ((String)iter.next()).trim();
            if (prefix == null || key.startsWith(prefix)) {
               Object val = info.getObject(key);
               if (prefix != null)
                  key = key.substring(prefix.length());
               if (dbHelper != null) {
                  key = dbHelper.getIdentifier(key);
               }
               log.fine("found and adding key='" + key + "' on object map for prefix='" + prefix + "'");
               map.put(key, val);
            }
         }
         return map;
      }
   }
View Full Code Here

  public ShoppingBasket() {
    sGuCustomer = null;
    oLines = new ArrayList();
    oProps = new HashMap();
    oAddressesByName = new LinkedHashMap(13);
    oAddressesByIndex = new TreeMap();
    oLastLine = null;
    iLastLine = -1;
  }
View Full Code Here

   private String[] getHosts() {
      String prefix = "filewatcher.test.host.";
      Map hosts = InfoHelper.getPropertiesStartingWith(prefix, this, null);
      String[] keys = (String[])hosts.keySet().toArray(new String[hosts.size()]);
      TreeMap newHosts = new TreeMap();
     
      // we want them in a random order
      Random random = new Random();
      for (int i=0; i < keys.length; i++) {
         String tmp = (String)hosts.get(keys[i]);
         int nmax = Integer.parseInt(tmp);
         if (nmax < 1)
            nmax = 1;
         else if (nmax > 10)
            nmax = 10;
         for (int j=0; j < nmax; j++) {
            Double newKey = new Double(random.nextDouble());
            newHosts.put(newKey, keys[i]);
         }
      }
      return (String[])newHosts.values().toArray(new String[newHosts.size()]);
   }
View Full Code Here

    }

    protected Map handleGetAllMessages()
    {
        final boolean normalize = this.normalizeMessages();
        final Map messages = (normalize) ? (Map)new TreeMap() : (Map)new LinkedHashMap();

        if (this.isApplicationUseCase())
        {
            final List useCases = this.getAllUseCases();
            for (int i = 0; i < useCases.size(); i++)
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.