Package java.util

Examples of java.util.NavigableSet.pollFirst()


        if (entrySet instanceof NavigableSet) {
            NavigableSet descendingSubMapEntrySet = ((NavigableSet) entrySet)
                    .descendingSet();
            assertEquals(8, descendingSubMapEntrySet.size());
            for (int i = 101; i < 109; i++) {
                entry = (Entry) descendingSubMapEntrySet.pollFirst();
                assertEquals(i, entry.getValue());
            }
            assertNull(descendingSubMapEntrySet.pollFirst());
        }
    }
View Full Code Here


            assertEquals(8, descendingSubMapEntrySet.size());
            for (int i = 101; i < 109; i++) {
                entry = (Entry) descendingSubMapEntrySet.pollFirst();
                assertEquals(i, entry.getValue());
            }
            assertNull(descendingSubMapEntrySet.pollFirst());
        }
    }

    public void test_DescendingSubMapEntrySet_pollFirst_startExcluded_endIncluded() {
        Set entrySet = navigableMap_startExcluded_endIncluded.entrySet();
View Full Code Here

        if (entrySet instanceof NavigableSet) {
            NavigableSet descendingSubMapEntrySet = ((NavigableSet) entrySet)
                    .descendingSet();
            assertEquals(9, descendingSubMapEntrySet.size());
            for (int i = 101; i < 110; i++) {
                entry = (Entry) descendingSubMapEntrySet.pollFirst();
                assertEquals(i, entry.getValue());
            }
            assertNull(descendingSubMapEntrySet.pollFirst());
        }
    }
View Full Code Here

        if (entrySet instanceof NavigableSet) {
            NavigableSet descendingSubMapEntrySet = ((NavigableSet) entrySet)
                    .descendingSet();
            assertEquals(9, descendingSubMapEntrySet.size());
            for (int i = 100; i < 109; i++) {
                entry = (Entry) descendingSubMapEntrySet.pollFirst();
                assertEquals(i, entry.getValue());
            }
            assertNull(descendingSubMapEntrySet.pollFirst());
        }
    }
View Full Code Here

            assertEquals(9, descendingSubMapEntrySet.size());
            for (int i = 100; i < 109; i++) {
                entry = (Entry) descendingSubMapEntrySet.pollFirst();
                assertEquals(i, entry.getValue());
            }
            assertNull(descendingSubMapEntrySet.pollFirst());
        }
    }

    public void test_DescendingSubMapEntrySet_pollFirst_startIncluded_endIncluded() {
        Set entrySet = navigableMap_startIncluded_endIncluded.entrySet();
View Full Code Here

        if (entrySet instanceof NavigableSet) {
            NavigableSet descendingSubMapEntrySet = ((NavigableSet) entrySet)
                    .descendingSet();
            assertEquals(10, descendingSubMapEntrySet.size());
            for (int i = 100; i < 110; i++) {
                entry = (Entry) descendingSubMapEntrySet.pollFirst();
                assertEquals(i, entry.getValue());
            }
            assertNull(descendingSubMapEntrySet.pollFirst());
        }
    }
View Full Code Here

            assertEquals(10, descendingSubMapEntrySet.size());
            for (int i = 100; i < 110; i++) {
                entry = (Entry) descendingSubMapEntrySet.pollFirst();
                assertEquals(i, entry.getValue());
            }
            assertNull(descendingSubMapEntrySet.pollFirst());
        }
    }

    public void test_DescendingSubMapEntrySet_pollFirst() {
        String key = new Integer(2).toString();
View Full Code Here

        Entry entry;

        if (entrySet instanceof NavigableSet) {
            // [2...0]
            descendingEntrySet = ((NavigableSet) entrySet).descendingSet();
            entry = (Entry) descendingEntrySet.pollFirst();
            assertEquals(0, entry.getValue());
        }

        entrySet = tm.tailMap(key, true).entrySet();
        if (entrySet instanceof NavigableSet) {
View Full Code Here

        }

        entrySet = tm.tailMap(key, true).entrySet();
        if (entrySet instanceof NavigableSet) {
            descendingEntrySet = ((NavigableSet) entrySet).descendingSet();
            entry = (Entry) descendingEntrySet.pollFirst();
            assertEquals(2, entry.getValue());
        }
    }

    public void test_DescendingSubMapEntrySet_pollLast_startExcluded_endExclued() {
View Full Code Here

            assertEquals(8, descendingSubMapEntrySet.size());
            for (int i = 108; i > 100; i--) {
                entry = (Entry) descendingSubMapEntrySet.pollLast();
                assertEquals(i, entry.getValue());
            }
            assertNull(descendingSubMapEntrySet.pollFirst());
        }
    }

    public void test_DescendingSubMapEntrySet_pollLast_startExcluded_endInclued() {
        Set entrySet = navigableMap_startExcluded_endIncluded.entrySet();
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.