Package java.util

Examples of java.util.TreeMap$State


            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

  }

  // -----------------------------------------------------------------

  public void ejbCreate() throws CreateException {
     oBTree = Collections.synchronizedSortedMap(new TreeMap());
  }
View Full Code Here

    int f, s, e;
    StringBuffer oReport = new StringBuffer(4096);
    String sLine, sOpCode = null, sEntity = null;

    TreeMap oOpen  = new TreeMap();
    Integer oCount;

    LineNumberReader lnr;

    FileReader oReader = new FileReader(sFile);
    BufferedReader oBuffer = new BufferedReader(oReader);
    LineNumberReader oLines = new LineNumberReader(oBuffer);

    while ((sLine = oLines.readLine())!=null) {
      f = 0;
      s = -1;
      while ((s=sLine.indexOf(';',s+1))!=-1) {
        f++;
        switch (f) {
          case 2:
            sOpCode = sLine.substring(s, sLine.indexOf(';', s+1));
            break;
          case 4:
            sEntity = sLine.substring(s, sLine.indexOf(';', s+1));

            if (sOpCode.equals("ODBC") || sOpCode.equals("OJSP")) {
              oCount = (Integer) oOpen.get(sEntity);
              if (oCount==null) {
                oCount = new Integer(1);
                oOpen.put(sEntity, oCount);
              }
              else {
                oCount = new Integer(oCount.intValue()+1);
                oOpen.remove(sEntity);
                oOpen.put(sEntity, oCount);
              }
            } // fi (sOpCode==ODBC)
            else if (sOpCode.equals("CDBC") || sOpCode.equals("CJSP")) {
              oCount = (Integer) oOpen.get(sEntity);
              if (oCount==null) {
                oCount = new Integer(-1);
                oOpen.put(sEntity, oCount);
              }
              else {
                oCount = new Integer(oCount.intValue()-1);
                oOpen.remove(sEntity);
                oOpen.put(sEntity, oCount);
              }
            }
            break;
        } // switch(f)
      } // wend
      if (f%10==0) System.out.print('.');
    } // wend

    System.out.print("\n");

    oReader.close();
    oLines.close();
    oBuffer.close();

    Iterator oKeys = oOpen.keySet().iterator();

    while (oKeys.hasNext()) {
      sEntity = (String) oKeys.next();
      oCount = (Integer) oOpen.get(sEntity);

      if (oCount.intValue()!=0) {
        oReport.append(sEntity + " open/close mismatch " + oCount.toString() + "\n");
      }
    } // wend
View Full Code Here

TOP

Related Classes of java.util.TreeMap$State

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.