Examples of ReverseComparator


Examples of org.apache.commons.collections.comparators.ReverseComparator

    public TestDualTreeBidiMap2(String testName) {
        super(testName);
    }

    public BidiMap makeEmptyBidiMap() {
        return new DualTreeBidiMap(new ReverseComparator(ComparableComparator.getInstance()));
    }
View Full Code Here

Examples of org.apache.commons.collections.comparators.ReverseComparator

    public BidiMap makeEmptyBidiMap() {
        return new DualTreeBidiMap(new ReverseComparator(ComparableComparator.getInstance()));
    }

    public Map makeConfirmedMap() {
        return new TreeMap(new ReverseComparator(ComparableComparator.getInstance()));
    }
View Full Code Here

Examples of org.apache.commons.collections.comparators.ReverseComparator

    public void testSortOrder() throws Exception {
        SortedBidiMap sm = (SortedBidiMap) makeFullMap();

        // Sort by the comparator used in the makeEmptyBidiMap() method
        List newSortedKeys = Arrays.asList(getSampleKeys());
        Collections.sort(newSortedKeys, new ReverseComparator(ComparableComparator.getInstance()));
        newSortedKeys = Collections.unmodifiableList(newSortedKeys);

        Iterator mapIter = sm.keySet().iterator();
        Iterator expectedIter = newSortedKeys.iterator();
        while (expectedIter.hasNext()) {
View Full Code Here

Examples of org.apache.commons.collections.comparators.ReverseComparator

            // expected
        }
    }

    public void testBasicComparatorOps() {
        BinaryHeap heap = new BinaryHeap(new ReverseComparator(new ComparableComparator()));

        assertTrue("heap should be empty after create", heap.isEmpty());

        try {
            heap.peek();
View Full Code Here

Examples of org.apache.commons.collections.comparators.ReverseComparator

     */
    public static Comparator reversedComparator(Comparator comparator) {
        if (comparator == null) {
            comparator = NATURAL_COMPARATOR;
        }
        return new ReverseComparator(comparator);
    }
View Full Code Here

Examples of org.apache.commons.collections.comparators.ReverseComparator

        /* .\ Filter by Newest Version \.___________________________________________ */

        // We have 2 or more nodes that are equal distance from the root.
        // Determine which one is 'newest' based on version id.
        Collections.sort( remainingNodes, new ReverseComparator( new NodeLocationVersionComparator() ) );

        NodeLocation nodeloc = (NodeLocation) remainingNodes.get( 0 );
        return nodeloc.artifact;
    }
View Full Code Here

Examples of org.apache.commons.collections.comparators.ReverseComparator

                reverse = Boolean.valueOf((String) reverseProperty);
            }
           
            Class<?> clazz = Class.forName(comparatorClassName.toString());
            Comparator<?> comparator = (Comparator<?>)clazz.newInstance();
            return reverse ? new ReverseComparator(comparator) : comparator;
        }
        return null;
    }
View Full Code Here

Examples of org.apache.commons.collections.comparators.ReverseComparator

        int ilimit = useLimit(rreq.getRequest());
        rreq.getRequest().setAttribute("limit", new Integer(ilimit));
        if (ioffset + ilimit > hits.length()) ilimit = hits.length()-ioffset;
       
        boolean websiteSpecificSearch = checkForWebsite(rreq.getRequest());
        TreeMap searchResults = new TreeMap(new ReverseComparator());
        TreeSet categories = new TreeSet();
        Roller roller = RollerFactory.getRoller();
        UserManager userMgr = roller.getUserManager();
        WeblogManager weblogMgr =roller.getWeblogManager();
        WeblogEntryData entry;
View Full Code Here

Examples of org.apache.commons.collections.comparators.ReverseComparator

    }

    protected Comparator<DbEntity> getDbEntityComparator(boolean dependantFirst) {
        Comparator<DbEntity> c = dbEntityComparator;
        if (dependantFirst) {
            c = new ReverseComparator(c);
        }
        return c;
    }
View Full Code Here

Examples of org.apache.commons.collections15.comparators.ReverseComparator

        } catch (BufferUnderflowException ex) {
        }
    }

    public void testBasicComparatorOps() {
        PriorityBuffer heap = new PriorityBuffer(new ReverseComparator(new ComparableComparator()));

        assertTrue("heap should be empty after create", heap.isEmpty());

        try {
            heap.get();
View Full Code Here
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.