Examples of pollFirst()


Examples of java.util.ArrayDeque.pollFirst()

            // record accessed nodes to avoid second access
            Set<Node> recorder = new HashSet(entrance.incoming);
            recorder.add(entrance);

            while (!candidates.isEmpty()) {
                Node node = candidates.pollFirst();

                if (recorder.add(node)) {
                    if (!node.hasDominator(base)) {
                        exit = node;
                        break;
View Full Code Here

Examples of java.util.ArrayDeque.pollFirst()

                    Deque<Node> queue = new ArrayDeque();
                    queue.add(catchBlock.node);

                    while (!queue.isEmpty()) {
                        Node node = queue.pollFirst();

                        for (Node out : node.outgoing) {
                            if (out.hasDominator(catchBlock.node)) {
                                if (recorder.add(out)) {
                                    // test next node
View Full Code Here

Examples of java.util.ArrayDeque.pollFirst()

            nodes.addAll(end.outgoing); // then end node

            Set<Node> recorder = new HashSet(nodes);

            while (!nodes.isEmpty()) {
                Node node = nodes.pollFirst();

                if (node.getDominator() == start) {
                    exit = node;
                    return;
                }
View Full Code Here

Examples of java.util.ArrayDeque.pollFirst()

        Deque<Node> queue = new ArrayDeque();
        queue.add(this);

        while (!queue.isEmpty()) {
            for (Node out : queue.pollFirst().outgoing) {
                if (out == node) {
                    return true;
                }

                if (!exclusions.contains(out) && recorder.add(out)) {
View Full Code Here

Examples of java.util.ArrayDeque.pollFirst()

    public void poll() throws Exception {
        ArrayDeque deque = create();
        assert deque.size() == 4;
        assert deque.poll().equals("1");
        assert deque.size() == 3;
        assert deque.pollFirst().equals("2");
        assert deque.size() == 2;
        assert deque.pollLast().equals("4");
        assert deque.size() == 1;
    }
View Full Code Here

Examples of java.util.NavigableSet.pollFirst()

        NavigableSet keySet = navigableMap_startExcluded_endExcluded
                .navigableKeySet();
        Iterator iterator = keySet.iterator();
        assertEquals(8, keySet.size());
        for (int value = 101; value < 109; value++) {
            assertEquals(new Integer(value).toString(), keySet.pollFirst());
        }
        assertEquals(0, keySet.size());
        assertNull(keySet.pollFirst());
    }
View Full Code Here

Examples of java.util.NavigableSet.pollFirst()

        assertEquals(8, keySet.size());
        for (int value = 101; value < 109; value++) {
            assertEquals(new Integer(value).toString(), keySet.pollFirst());
        }
        assertEquals(0, keySet.size());
        assertNull(keySet.pollFirst());
    }

    public void test_AscendingSubMapKeySet_pollFirst_startExcluded_endIncluded() {
        NavigableSet keySet = navigableMap_startExcluded_endIncluded
                .navigableKeySet();
View Full Code Here

Examples of java.util.NavigableSet.pollFirst()

        NavigableSet keySet = navigableMap_startExcluded_endIncluded
                .navigableKeySet();
        Iterator iterator = keySet.iterator();
        assertEquals(9, keySet.size());
        for (int value = 101; value < 110; value++) {
            assertEquals(new Integer(value).toString(), keySet.pollFirst());
        }
        assertEquals(0, keySet.size());
        assertNull(keySet.pollFirst());
    }
View Full Code Here

Examples of java.util.NavigableSet.pollFirst()

        assertEquals(9, keySet.size());
        for (int value = 101; value < 110; value++) {
            assertEquals(new Integer(value).toString(), keySet.pollFirst());
        }
        assertEquals(0, keySet.size());
        assertNull(keySet.pollFirst());
    }

    public void test_AscendingSubMapKeySet_pollFirst_startIncluded_endExcluded() {
        NavigableSet keySet = navigableMap_startIncluded_endExcluded
                .navigableKeySet();
View Full Code Here

Examples of java.util.NavigableSet.pollFirst()

        NavigableSet keySet = navigableMap_startIncluded_endExcluded
                .navigableKeySet();
        Iterator iterator = keySet.iterator();
        assertEquals(9, keySet.size());
        for (int value = 100; value < 109; value++) {
            assertEquals(new Integer(value).toString(), keySet.pollFirst());
        }
        assertEquals(0, keySet.size());
        assertNull(keySet.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.