Package java.util

Examples of java.util.TreeSet$MyIterator


  
   private TreeSet prepareEntries(File directory, Map existingFiles) {
      if (log.isLoggable(Level.FINER))
         log.finer(ME+": prepareEntries");
     
      TreeSet chronologicalSet = new TreeSet(new FileComparator());
      if (existingFiles == null || existingFiles.size() < 1) {
         if (log.isLoggable(Level.FINEST)) {
            log.finest(ME+": prepareEntries: nothing to do");
         }
      }
      Iterator iter = existingFiles.values().iterator();
      long currentTime = System.currentTimeMillis();
      while (iter.hasNext()) {
         FileInfo info = (FileInfo)iter.next();
        
         if (isReady(info, currentTime)) {
            chronologicalSet.add(info);
         }
      }
      return chronologicalSet;
   }
View Full Code Here


         conn.setAutoCommit(true);
         st = conn.prepareStatement(getKeysSql);
         st.setString(1, this.context);

         ResultSet rs = st.executeQuery();
         Set ret = new TreeSet();
        
         while (rs.next()) {
            ret.add(rs.getString(1));
         }
         return ret;
      }
      finally {
         if (st != null) {
View Full Code Here

      if (log.isLoggable(Level.FINER)) log.finer("getStartupSequence for node '" + nodeId +
                         "' and runlevel '" + lowRunlevel + "' to '" + highRunlevel + "'");
      if (lowRunlevel > highRunlevel) {
         log.severe(".getStartupSequence: the low run level '" + lowRunlevel + "' is higher than the high run level '" + highRunlevel + "'");
      }
      TreeSet startupSet = new TreeSet(new PluginConfigComparator(this.glob, true));
      PluginConfig[] plugins = getAllPluginConfig(nodeId);
      for (int i=0; i < plugins.length; i++) {
         RunLevelAction action = plugins[i].getUpAction();
         if (action != null) {
            int runlevel = action.getOnStartupRunlevel();
            if (runlevel >= lowRunlevel && runlevel <= highRunlevel)
               startupSet.add(plugins[i]);
         }
      }
      return startupSet;
   }
View Full Code Here

      if (log.isLoggable(Level.FINER)) log.finer("getShutdownSequence for node '" + nodeId +
                        "' and runlevel '" + lowRunlevel + "' to '" + highRunlevel + "'");
      if (lowRunlevel > highRunlevel) {
         log.severe(".getShutdownSequence: the low run level '" + lowRunlevel + "' is higher than the high run level '" + highRunlevel + "'");
      }
      TreeSet shutdownSet = new TreeSet(new PluginConfigComparator(this.glob, false));
      PluginConfig[] plugins = getAllPluginConfig(nodeId);
      for (int i=0; i < plugins.length; i++) {
         RunLevelAction action = plugins[i].getDownAction();
         if (action != null) {
            int runlevel = action.getOnShutdownRunlevel();
            if (runlevel >= lowRunlevel && runlevel <= highRunlevel)
               shutdownSet.add(plugins[i]);
         }
      }
      return shutdownSet;
   }
View Full Code Here

   /**
    *
    */
   private void startupPlugins(int from, int to) throws XmlBlasterException {
      TreeSet pluginSet = this.glob.getPluginHolder().getStartupSequence(this.glob.getStrippedId(), from+1, to);
      if (log.isLoggable(Level.FINER)) log.finer("startupPlugins. the size of the plugin set is '" + pluginSet.size() + "'");
      Iterator iter = pluginSet.iterator();
      while (iter.hasNext()) {
         PluginConfig pluginConfig = (PluginConfig)iter.next();
         if (pluginConfig == null) {
            log.warning("startupPlugins. the pluginConfig object is null");
            continue;
View Full Code Here

   /**
    *
    */
   private void shutdownPlugins(int from, int to) throws XmlBlasterException {
      TreeSet pluginSet = this.glob.getPluginHolder().getShutdownSequence(this.glob.getStrippedId(), to, from-1);
      Iterator iter = pluginSet.iterator();
      while (iter.hasNext()) {
         PluginConfig pluginConfig = (PluginConfig)iter.next();
         if (pluginConfig == null || !pluginConfig.isCreate())
            continue;

View Full Code Here

    TestBean tbY = new TestBean("nameY", 0);
    this.array = new TestBean[] {tb0, tb1};
    this.list = new ArrayList();
    this.list.add(tb2);
    this.list.add(tb3);
    this.set = new TreeSet();
    this.set.add(tb6);
    this.set.add(tb7);
    this.map = new HashMap();
    this.map.put("key1", tb4);
    this.map.put("key2", tb5);
View Full Code Here

    /**
     * Returns the argument as an ordered set.
     */
    public static Set asOrderedSet(final Collection collection)
    {
        return collection == null ? Collections.EMPTY_SET : SetUtils.orderedSet(new TreeSet(collection));
    }
View Full Code Here

        }
    }

    private void setAllowedMethods(Enumeration allowedMethods)
    {
        this.allowedMethods = new TreeSet();

        if (allowedMethods == null)
        {
            return;
        }
View Full Code Here

  if (nLocalDates==0) {
    oRetVal = this;
  } else if (nThisDates==0) {
    oRetVal = oLocalCalendar;
  } else {
    TreeSet oUnionDates = new TreeSet();
    for (int d=0; d<nThisDates; d++) {
      oUnionDates.add(String.valueOf(aDates[d]));
    } // next
    for (int d=0; d<nLocalDates; d++) {
      String sDate = String.valueOf(oLocalCalendar.aDates[d]);
      if (!oUnionDates.contains(sDate))
        oUnionDates.add(sDate);
    } // next
    int nUnionDates = oUnionDates.size();
    oRetVal = new WorkingCalendar(nUnionDates,
                                  getStringNull(DB.nm_calendar,"")+"+"+oLocalCalendar.getStringNull(DB.nm_calendar,""),
                                  toDate(oUnionDates.first().toString()),
                                  toDate(oUnionDates.last().toString()));
    Iterator oIter = oUnionDates.iterator();
    int iCurrentDateIndex = 0;
    while (oIter.hasNext()) {
      int iDate = Integer.parseInt((String) oIter.next());
      int iLocalDateIndex = Arrays.binarySearch(oLocalCalendar.aDates, iDate);
    if (iLocalDateIndex>=0) {
View Full Code Here

TOP

Related Classes of java.util.TreeSet$MyIterator

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.