Examples of pollFirst()


Examples of java.util.NavigableSet.pollFirst()

        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

Examples of java.util.NavigableSet.pollFirst()

            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

Examples of java.util.NavigableSet.pollFirst()

        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

Examples of java.util.NavigableSet.pollFirst()

        }

        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

Examples of java.util.NavigableSet.pollFirst()

            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

Examples of java.util.NavigableSet.pollFirst()

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

    public void test_DescendingSubMapEntrySet_pollLast_startIncluded_endExclued() {
        Set entrySet = navigableMap_startIncluded_endExcluded.entrySet();
View Full Code Here

Examples of java.util.NavigableSet.pollFirst()

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

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

Examples of java.util.NavigableSet.pollFirst()

            assertEquals(10, descendingSubMapEntrySet.size());
            for (int i = 109; i > 99; i--) {
                entry = (Entry) descendingSubMapEntrySet.pollLast();
                assertEquals(i, entry.getValue());
            }
            assertNull(descendingSubMapEntrySet.pollFirst());
        }
    }

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

Examples of java.util.NavigableSet.pollFirst()

    public void test_DescendingSubMapKeySet_pollFirst() {
        String endKey = new Integer(2).toString();
        NavigableSet keySet = tm.headMap(endKey, true).navigableKeySet();
        NavigableSet descendingKeySet = keySet.descendingSet();
        assertEquals(endKey, descendingKeySet.pollFirst());
    }

    public void test_DescendingSubMapKeySet_pollLast_startExcluded_endExcluded() {
        NavigableSet keySet = navigableMap_startExcluded_endExcluded
                .navigableKeySet();
View Full Code Here

Examples of java.util.NavigableSet.pollFirst()

    public void test_AscendingSubMapEntrySet_pollFirst_startExcluded_endExcluded() {
        Set entrySet = navigableMap_startExcluded_endExcluded.entrySet();
        if (entrySet instanceof NavigableSet) {
            NavigableSet ascendingSubMapEntrySet = (NavigableSet) entrySet;
            for (int value = 101; value < 109; value++) {
                Entry entry = (Entry) ascendingSubMapEntrySet.pollFirst();
                assertEquals(value, entry.getValue());
            }
            assertTrue(ascendingSubMapEntrySet.isEmpty());
            // should return null if the set is empty.
            assertNull(ascendingSubMapEntrySet.pollFirst());
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.