Examples of subMap()


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

    /**
     * subMap returns map with keys in requested range
     */
    public void testSubMapContents() {
        SnapTreeMap map = map5();
        NavigableMap sm = map.subMap(two, true, four, false);
        assertEquals(two, sm.firstKey());
        assertEquals(three, sm.lastKey());
        assertEquals(2, sm.size());
        assertFalse(sm.containsKey(one));
        assertTrue(sm.containsKey(two));
View Full Code Here

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

        assertEquals(3, map.size());
    }

    public void testSubMapContents2() {
        SnapTreeMap map = map5();
        NavigableMap sm = map.subMap(two, true, three, false);
        assertEquals(1, sm.size());
        assertEquals(two, sm.firstKey());
        assertEquals(two, sm.lastKey());
        assertFalse(sm.containsKey(one));
        assertTrue(sm.containsKey(two));
View Full Code Here

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

        map.put(two, "B");
        map.put(four, "D");
        map.put(seven, "F");
        assertFalse(map.isEmpty());
        assertEquals(7, map.size());
        return map.subMap(one, true, seven, false);
    }

    /**
     * Create a map from Integers -5 to -1 to Strings "A"-"E".
     */
 
View Full Code Here

Examples of java.util.NavigableMap.subMap()

    public void test_DescendingSubMap_subMap() {
        NavigableMap descendingMap = tm.descendingMap();
        String startKey = new Integer(109).toString();
        String endKey = new Integer(100).toString();
        try {
            descendingMap.subMap(endKey, false, startKey, false);
        } catch (IllegalArgumentException e) {
            // Expected
        }

        SortedMap subDescendingMap = descendingMap.subMap(startKey, false,
View Full Code Here

Examples of java.util.NavigableMap.subMap()

            descendingMap.subMap(endKey, false, startKey, false);
        } catch (IllegalArgumentException e) {
            // Expected
        }

        SortedMap subDescendingMap = descendingMap.subMap(startKey, false,
                endKey, false);
        String key = new Integer(100).toString();
        assertFalse(subDescendingMap.containsKey(key));
        for (int i = 101; i < 109; i++) {
            key = new Integer(i).toString();
View Full Code Here

Examples of java.util.NavigableMap.subMap()

            assertTrue(subDescendingMap.containsKey(key));
        }
        key = new Integer(109).toString();
        assertFalse(subDescendingMap.containsKey(key));

        subDescendingMap = descendingMap.subMap(startKey, false, endKey, true);
        key = new Integer(100).toString();
        assertTrue(subDescendingMap.containsKey(key));
        for (int i = 101; i < 109; i++) {
            key = new Integer(i).toString();
            assertTrue(subDescendingMap.containsKey(key));
View Full Code Here

Examples of java.util.NavigableMap.subMap()

            assertTrue(subDescendingMap.containsKey(key));
        }
        key = new Integer(109).toString();
        assertFalse(subDescendingMap.containsKey(key));

        subDescendingMap = descendingMap.subMap(startKey, true, endKey, false);
        key = new Integer(100).toString();
        assertFalse(subDescendingMap.containsKey(key));
        for (int i = 101; i < 109; i++) {
            key = new Integer(i).toString();
            assertTrue(subDescendingMap.containsKey(key));
View Full Code Here

Examples of java.util.NavigableMap.subMap()

            assertTrue(subDescendingMap.containsKey(key));
        }
        key = new Integer(109).toString();
        assertTrue(subDescendingMap.containsKey(key));

        subDescendingMap = descendingMap.subMap(startKey, true, endKey, true);
        key = new Integer(100).toString();
        assertTrue(subDescendingMap.containsKey(key));
        for (int i = 101; i < 109; i++) {
            key = new Integer(i).toString();
            assertTrue(subDescendingMap.containsKey(key));
View Full Code Here

Examples of java.util.NavigableMap.subMap()

        TreeMap<Integer, String> treeMap = new TreeMap<Integer, String>();
        for (int i = -10; i < 10; i++) {
            treeMap.put(i, String.valueOf(i));
        }
        descendingMap = treeMap.descendingMap();
        subDescendingMap = descendingMap.subMap(5, 0);
        assertEquals(5, subDescendingMap.size());
    }

    public void test_DescendingSubMap_tailMap() {
        // tm
View Full Code Here

Examples of java.util.NavigableMap.subMap()

            fail("should throw IAE");
        } catch (IllegalArgumentException e) {
        }
        map = map.descendingMap();
        try {
            map = map.subMap(objArray[103].toString(), true, objArray[102]
                    .toString(), true);
            fail("should throw IAE");
        } catch (IllegalArgumentException e) {
        }
        map = map.subMap(objArray[102].toString(), true, objArray[102]
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.