Examples of LinkedList


Examples of java.util.LinkedList

         }
                
      }


      return new LinkedList(memberships);
   }

Examples of java.util.LinkedList

        if (allAppenders != null) {
            //
            // this list has to guarantee the order in which elements are added
            //
            List uniqueList = new LinkedList();
            Comparator cmp = new LogDestinationComparator(all);

            Collections.sort(allAppenders, cmp);
            for (int i = 0; i < allAppenders.size(); i++) {
                LogDestination dest = (LogDestination) allAppenders.get(i);
                if (Collections.binarySearch(uniqueList, dest, cmp) < 0) {
                    if (all || dest.getFile() == null || dest.getFile().exists()) {
                        uniqueList.add(new DisconnectedLogDestination(dest));
                    }
                }
            }
            return uniqueList;
        }

Examples of java.util.LinkedList

        }
        return null;
    }

    public List getLogSources(File logFile) {
        List filtered = new LinkedList();
        List sources = getLogSources();
        for (int i = 0; i < sources.size(); i++) {
            LogDestination dest = (LogDestination) sources.get(i);
            if (logFile.equals(dest.getFile())) {
                filtered.add(dest);
            }
        }
        return filtered;
    }

Examples of java.util.LinkedList

        }
        return filtered;
    }

    public List getLogSources() {
        List sources = new LinkedList();

        List allAppenders = getAllLogDestinations();
        if (allAppenders != null) {
            Comparator cmp = new LogSourceComparator();

            Collections.sort(allAppenders, cmp);
            for (int i = 0; i < allAppenders.size(); i++) {
                LogDestination dest = (LogDestination) allAppenders.get(i);
                if (Collections.binarySearch(sources, dest, cmp) < 0) {
                    sources.add(new DisconnectedLogDestination(dest));
                }
            }
        }
        return sources;
    }

Examples of java.util.LinkedList

        }
        if(ns == null){
            ArgCheck.isNotNull(ns,CorePlugin.Util.getString("JdomHelper.The_Namespace_reference_may_not_be_null_14")); //$NON-NLS-1$
        }

        final List results = new LinkedList();
        switch( traversalMethod ) {
            case PRE_ORDER_TRAVERSAL :
                preOrderTraversal( parent,
                    new XMLVisitor() {
                        public void visit( Object obj ) {
                            if( ((Element)obj).getNamespace().equals(ns) ) {
                                results.add( obj );
                            }
                        }
                    }
                );
                break;
            case POST_ORDER_TRAVERSAL :
                postOrderTraversal( parent,
                    new XMLVisitor() {
                        public void visit( Object obj ) {
                            if( ((Element)obj).getNamespace().equals(ns) ) {
                                results.add( obj );
                            }
                        }
                    }
                );
                break;
            case LEVEL_ORDER_TRAVERSAL :
                levelOrderTraversal( parent,
                    new XMLVisitor() {
                        public void visit( Object obj ) {
                            if( ((Element)obj).getNamespace().equals(ns) ) {
                                results.add( obj );
                            }
                        }
                    }
                );
                break;

Examples of java.util.LinkedList

    public static List getDescendents( Element parent ) {
        if(parent == null){
            ArgCheck.isNotNull(parent,CorePlugin.Util.getString("JdomHelper.The_JDOM_Element_reference_may_not_be_null_15")); //$NON-NLS-1$
        }

        final List results = new LinkedList();
        levelOrderTraversal( parent,
            new XMLVisitor() {
                public void visit( Object obj ) {
                    results.add( obj );
                }
            }
        );
        return results;
    }

Examples of java.util.LinkedList

       
        if(name.length() == 0){
            ArgCheck.isNotZeroLength(name,CorePlugin.Util.getString("JdomHelper.The_name_may_not_be_zero-length_18")); //$NON-NLS-1$
        }

        final List results = new LinkedList();
        levelOrderTraversal( parent,
            new XMLVisitor() {
                public void visit( Object obj ) {
                    if( ((Element)obj).getName().equals(name) ) {
                        results.add( obj );
                    }
                }
            }
        );
        return results;

Examples of java.util.LinkedList

        }
        if(ns == null){
            ArgCheck.isNotNull(ns,CorePlugin.Util.getString("JdomHelper.The_Namespace_may_not_be_null_20")); //$NON-NLS-1$
        }

        final List results = new LinkedList();
        levelOrderTraversal( parent,
            new XMLVisitor() {
                public void visit( Object obj ) {
                    if( ((Element)obj).getNamespace().equals(ns) ) {
                        results.add( obj );
                    }
                }
            }
        );
        return results;

Examples of java.util.LinkedList

    private Log logger = LogFactory.getLog(this.getClass());

    public List getPools() throws Exception {

        List memoryPools = new LinkedList();
        MBeanServer mBeanServer = new Registry().getMBeanServer();
        Set memoryOPools = mBeanServer.queryMBeans(new ObjectName("java.lang:type=MemoryPool,*"), null);

        //
        // totals
        //
        long totalInit = 0;
        long totalMax = 0;
        long totalUsed = 0;
        long totalCommitted = 0;

        for (Iterator it = memoryOPools.iterator(); it.hasNext();) {
            ObjectInstance oi = (ObjectInstance) it.next();
            ObjectName oName = oi.getObjectName();
            MemoryPool memoryPool = new MemoryPool();
            memoryPool.setName(JmxTools.getStringAttr(mBeanServer, oName, "Name"));
            memoryPool.setType(JmxTools.getStringAttr(mBeanServer, oName, "Type"));

            CompositeDataSupport cd = (CompositeDataSupport) mBeanServer.getAttribute(oName, "Usage");
            //
            // It seems that "Usage" attribute of one of the pools may turn into null intermittently. We better have a
            // dip in the graph then an NPE though.
            //
            if (cd != null) {
                memoryPool.setMax(JmxTools.getLongAttr(cd, "max"));
                memoryPool.setUsed(JmxTools.getLongAttr(cd, "used"));
                memoryPool.setInit(JmxTools.getLongAttr(cd, "init"));
                memoryPool.setCommitted(JmxTools.getLongAttr(cd, "committed"));
            } else {
                logger.error("Oops, JVM problem? "+oName.toString()+" \"Usage\" attribute is NULL!");
            }

            totalInit += memoryPool.getInit();
            totalMax += memoryPool.getMax();
            totalUsed += memoryPool.getUsed();
            totalCommitted += memoryPool.getCommitted();

            memoryPools.add(memoryPool);
        }

        if (!memoryPools.isEmpty()) {
            MemoryPool pool = new MemoryPool();
            pool.setName("Total");
            pool.setType("TOTAL");
            pool.setInit(totalInit);
            pool.setUsed(totalUsed);
            pool.setMax(totalMax);
            pool.setCommitted(totalCommitted);
            memoryPools.add(pool);
        }

        return memoryPools;

    }

Examples of java.util.LinkedList

       
        if(name.length() == 0){
            ArgCheck.isNotZeroLength(name,CorePlugin.Util.getString("JdomHelper.The_name_may_not_be_zero-length_23")); //$NON-NLS-1$
        }

        final List results = new LinkedList();
        levelOrderTraversal( parent,
            new XMLVisitor() {
                public void visit( Object obj ) {
                    if( ((Element)obj).getName().equals(name) && ((Element)obj).getNamespace().equals(ns) ) {
                        results.add( obj );
                    }
                }
            }
        );
        return results;
TOP
Copyright © 2018 www.massapi.com. 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.