Package java.util

Examples of java.util.TreeSet


      return LevelList.EMPTY_INTEGER_ARRAY;
    }
    if (iteratorSetDesc == null)
    {
      final Integer[] ilevels = (Integer[]) levels.toArray(new Integer[levels.size()]);
      iteratorSetDesc = new TreeSet(new DescendingComparator());
      for (int i = 0; i < ilevels.length; i++)
      {
        if (iteratorSetDesc.contains(ilevels[i]) == false)
        {
          iteratorSetDesc.add(ilevels[i]);
View Full Code Here


   */
  public Iterator getLevelsDescending()
  {
    if (iteratorSetDesc == null)
    {
      iteratorSetDesc = new TreeSet(new DescendingComparator());
      final Integer[] ilevels = (Integer[]) levels.toArray(new Integer[levels.size()]);
      for (int i = 0; i < ilevels.length; i++)
      {
        if (iteratorSetDesc.contains(ilevels[i]) == false)
        {
View Full Code Here

     * configured libraries.
     *
     * @return a set of library names
     */
    public Set keySet() {
        return new TreeSet(lib_pathmap.keySet());
    }
View Full Code Here

* Command line program to wander the vpfservlet pages, to make sure
* all URLs generated are valid.
*/
public class URLCheck {
    public static Set check(String surl, PrintStream out) throws IOException {
        Set urls = new TreeSet();
        out.println("URL " + surl);
        Reader r;
        URL url;
        try {
            url = new URL(surl);
            r = new InputStreamReader(url.openStream());
        } catch (MalformedURLException mue) {
            out.println("   bad URL");
            return urls;
        }
        Set names = new HashSet();
        Set localrefs = new HashSet();
        StringBuffer sb = new StringBuffer();
        char buf[] = new char[8096];
        int len;
        while ((len = r.read(buf)) != -1) {
            sb.append(buf, 0, len);
            String str = sb.toString();
            int fromIx = 0;
            int gt;
            while ((gt = str.indexOf('>', fromIx)) != -1) {
                int lt = str.indexOf('<', fromIx);
                fromIx = gt + 1;
                char firstChar = str.charAt(lt + 1);
                if ((firstChar != 'A') && (firstChar != 'a')) {
                    continue;
                }
                String substr = str.substring(lt + 1, gt);
                String lsubstr = substr.toLowerCase();

                int hquote = lsubstr.indexOf(href);
                if (hquote != -1) {
                    hquote += href.length();
                    int lquote = substr.indexOf('"', hquote);
                    String rurl = substr.substring(hquote, lquote);
                    if (rurl.charAt(0) == '#') {
                        names.add(rurl.substring(1));
                    } else {
                        try {
                            urls.add(new URL(url, rurl).toExternalForm());
                        } catch (MalformedURLException mue) {
                            out.println("   MUE: " + mue.getMessage());
                        }
                    }
                } else {
View Full Code Here

    this.blasterInstanceMap = new HashMap/*<String, BlasterInstance>*/();

    this.maxUserSessions = getConfProp("maxUserSessions",this.maxUserSessions);

    this.blockedIPs = new TreeSet/*<String>*/();
   
        // JMX
      try {
         Global glob = Global.instance();
           String instanceName = glob.validateJmxValue("AjaxServlet");
View Full Code Here

        return resolveable;
    }

    protected java.util.List handleGetAllManageables()
    {
        final Set allManageableEntities = new TreeSet(new ManageableComparator());

        final Collection allClasses = this.getModel().getAllClasses();
        for (final Iterator classIterator = allClasses.iterator(); classIterator.hasNext();)
        {
            final Object classObject = classIterator.next();
            if (classObject instanceof ManageableEntity)
            {
                allManageableEntities.add(classObject);
            }
        }
        return new ArrayList(allManageableEntities);
    }
View Full Code Here

        return resolveable;
    }

    protected java.util.List handleGetAllManageables()
    {
        final Set allManageableEntities = new TreeSet(new ManageableComparator());

        final Collection allClasses = getModel().getAllClasses();
        for (final Iterator classIterator = allClasses.iterator(); classIterator.hasNext();)
        {
            final Object classObject = classIterator.next();
            if (classObject instanceof ManageableEntity)
            {
                allManageableEntities.add(classObject);
            }
        }

        return new ArrayList(allManageableEntities);
    }
View Full Code Here

    * @see org.xmlBlaster.contrib.I_Info#getKeys()
    */
   public Set getKeys() {
      try {
         String[] tmp = this.prefs.childrenNames();
         Set set = new TreeSet();
         for (int i=0; i < tmp.length; i++)
            set.add(tmp[i]);
         return set;
      }
      catch (BackingStoreException ex) {
         ex.printStackTrace();
         return new TreeSet();
      }
   }
View Full Code Here

   *
   * @return the names of all ReceiverThreads found in the
   *         <code>Configuration</code>
   */
  public Set getAllReceiverThreads() {
    Set returnSet = new TreeSet();
    returnSet.addAll(mAllThreads.keySet());
    return returnSet;
  }
View Full Code Here

   *
   * @return the names of all running ReceiverThreads
   */
  public Set getRunningReceiverThreads() {
    int threadCount = mThreadGroup.activeCount();
    TreeSet retSet = new TreeSet();

    Thread[] startedThreads = new Thread[threadCount];
    mThreadGroup.enumerate(startedThreads);

    for (int i = 0; i < threadCount; i++) {
      if ((startedThreads[i] != null)
          && (mAllThreads.containsKey(startedThreads[i].getName()))) {
        retSet.add(startedThreads[i].getName());
      }
    }
    return retSet;
  }
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.