Package ca.odell.glazedlists.impl.filter

Examples of ca.odell.glazedlists.impl.filter.StringLengthComparator


        assertEquals(Collections.EMPTY_LIST, separatorList);
    }

    public void testSortedSource() {
        Comparator<String> alphabetical = GlazedLists.comparableComparator();
        Comparator<String> length = GlazedLists.reverseComparator(new StringLengthComparator());

        BasicEventList<String> unsortedSource = new BasicEventList<String>();
        SortedList<String> source = new SortedList<String>(unsortedSource, null);
        unsortedSource.addAll(Arrays.asList(new String[] { "apple", "banana", "cat", "dear", "frog", "boat", "car", "jesse", "glazed", "shirt", "hat", "art", "dog", "puppy", "foot" }));
View Full Code Here


     * Test that values that are indistinguishable by the SortedList are ordered
     * by their index.
     */
    public void testEqualValuesOrderedByIndex() {
        // create a sorted list that cannot distinguish between the data items
        Comparator<String> intCompareAt0 = GlazedLists.reverseComparator(new StringLengthComparator());
        sortedList.dispose();
        sortedList = new SortedList(unsortedList, intCompareAt0);

        // populate the unsorted list
        unsortedList.add(0, "chaos"); // c
View Full Code Here

        assertEquals(expectedOrder, sortedAgain);
    }

    public void testSortedSource() {
        Comparator<Comparable> alphabetical = GlazedLists.comparableComparator();
        Comparator<String> length = GlazedLists.reverseComparator(new StringLengthComparator());

        sortedList.setComparator(null);
        unsortedList.addAll(Arrays.asList(new String[] { "dddd", "aaa", "c", "bb" }));
        assertEquals(Arrays.asList(new String[] { "dddd", "aaa", "c", "bb" }), sortedList);
View Full Code Here

TOP

Related Classes of ca.odell.glazedlists.impl.filter.StringLengthComparator

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.