Package java.util

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


            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

            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

            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

            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

        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

            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

            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]
                .toString(), true);
        assertEquals(1, map.headMap(objArray[102].toString(), true).size());
        assertEquals(0, map.headMap(objArray[102].toString(), false).size());
        try {
            assertEquals(0, map.headMap(objArray[103].toString(), true).size());
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.