Examples of headMap()


Examples of edu.stanford.ppl.concurrent.SnapTreeMap.headMap()

    /**
     * headMap returns map with keys in requested range
     */
    public void testHeadMapContents() {
        SnapTreeMap map = map5();
        NavigableMap sm = map.headMap(four, false);
        assertTrue(sm.containsKey(one));
        assertTrue(sm.containsKey(two));
        assertTrue(sm.containsKey(three));
        assertFalse(sm.containsKey(four));
        assertFalse(sm.containsKey(five));
View Full Code Here

Examples of java.util.NavigableMap.headMap()

        assertTrue(subDecendingMap_Included.containsKey(key));
        assertFalse(subDecendingMap_Excluded.containsKey(key));

        endKey = new Integer(101).toString();
        subDecendingMap_Included = decendingMap.headMap(endKey, true);
        subDecendingMap_Excluded = decendingMap.headMap(endKey, false);

        key = endKey;
        assertTrue(subDecendingMap_Included.containsKey(key));
        assertFalse(subDecendingMap_Excluded.containsKey(key));
View Full Code Here

Examples of java.util.NavigableMap.headMap()

        assertFalse(subDecendingMap_Excluded.containsKey(key));

        decendingMap = ((NavigableMap) subMap_startIncluded_endIncluded_comparator)
                .descendingMap();
        endKey = new Integer(100).toString();
        subDecendingMap_Included = decendingMap.headMap(endKey, true);
        subDecendingMap_Excluded = decendingMap.headMap(endKey, false);
        key = endKey;
        assertTrue(subDecendingMap_Included.containsKey(key));
        assertFalse(subDecendingMap_Excluded.containsKey(key));
View Full Code Here

Examples of java.util.NavigableMap.headMap()

        decendingMap = ((NavigableMap) subMap_startIncluded_endIncluded_comparator)
                .descendingMap();
        endKey = new Integer(100).toString();
        subDecendingMap_Included = decendingMap.headMap(endKey, true);
        subDecendingMap_Excluded = decendingMap.headMap(endKey, false);
        key = endKey;
        assertTrue(subDecendingMap_Included.containsKey(key));
        assertFalse(subDecendingMap_Excluded.containsKey(key));

        endKey = new Integer(101).toString();
View Full Code Here

Examples of java.util.NavigableMap.headMap()

        key = endKey;
        assertTrue(subDecendingMap_Included.containsKey(key));
        assertFalse(subDecendingMap_Excluded.containsKey(key));

        endKey = new Integer(101).toString();
        subDecendingMap_Included = decendingMap.headMap(endKey, true);
        subDecendingMap_Excluded = decendingMap.headMap(endKey, false);

        key = endKey;
        assertTrue(subDecendingMap_Included.containsKey(key));
        assertFalse(subDecendingMap_Excluded.containsKey(key));
View Full Code Here

Examples of java.util.NavigableMap.headMap()

        assertTrue(subDecendingMap_Included.containsKey(key));
        assertFalse(subDecendingMap_Excluded.containsKey(key));

        endKey = new Integer(101).toString();
        subDecendingMap_Included = decendingMap.headMap(endKey, true);
        subDecendingMap_Excluded = decendingMap.headMap(endKey, false);

        key = endKey;
        assertTrue(subDecendingMap_Included.containsKey(key));
        assertFalse(subDecendingMap_Excluded.containsKey(key));
View Full Code Here

Examples of java.util.NavigableMap.headMap()

    }

    public void test_DescendingSubMap_headMap() {
        NavigableMap decendingMap = tm.descendingMap();
        String endKey = new Integer(0).toString(), key;
        SortedMap subDecendingMap_Included = decendingMap.headMap(endKey, true);
        SortedMap subDecendingMap_Excluded = decendingMap
                .headMap(endKey, false);
        key = endKey;
        assertTrue(subDecendingMap_Included.containsKey(key));
        assertFalse(subDecendingMap_Excluded.containsKey(key));
View Full Code Here

Examples of java.util.NavigableMap.headMap()

    public void test_DescendingSubMap_headMap() {
        NavigableMap decendingMap = tm.descendingMap();
        String endKey = new Integer(0).toString(), key;
        SortedMap subDecendingMap_Included = decendingMap.headMap(endKey, true);
        SortedMap subDecendingMap_Excluded = decendingMap
                .headMap(endKey, false);
        key = endKey;
        assertTrue(subDecendingMap_Included.containsKey(key));
        assertFalse(subDecendingMap_Excluded.containsKey(key));
        for (int i = 1; i < 1000; i++) {
View Full Code Here

Examples of java.util.NavigableMap.headMap()

        assertFalse(subDecendingMap_Excluded.containsKey(key));

        decendingMap = navigableMap_startExcluded_endExcluded.descendingMap();
        endKey = new Integer(100).toString();
        try {
            decendingMap.headMap(endKey, true);
            fail("should throw IllegalArgumentException");
        } catch (IllegalArgumentException e) {
            // Expected
        }
        subDecendingMap_Excluded = decendingMap.headMap(endKey, false);
View Full Code Here

Examples of java.util.NavigableMap.headMap()

            decendingMap.headMap(endKey, true);
            fail("should throw IllegalArgumentException");
        } catch (IllegalArgumentException e) {
            // Expected
        }
        subDecendingMap_Excluded = decendingMap.headMap(endKey, false);
        key = endKey;
        assertFalse(subDecendingMap_Excluded.containsKey(key));

        endKey = new Integer(101).toString();
        subDecendingMap_Included = decendingMap.headMap(endKey, true);
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.