Package java.util

Examples of java.util.TreeMap.lastEntry()


       
        q.put(ZERO, ZERO);
        r.putAll(this.coeffs);
       
        while (!isZero(r) && bdeg.le(r.lastKey())) {
            c = new Division(r.lastEntry().getValue(), bc).evaluate();
            n = (NaturalNumber) r.lastKey().subtract(bdeg);
           
            q.put(n, c);
           
            for (NaturalNumber i : b.coeffs.descendingKeySet()) {
View Full Code Here


        TreeMap treeMap = new TreeMap(tm);
        assertEquals(tm.size(), treeMap.size());
        assertEquals(tm.firstKey(), treeMap.firstKey());
        assertEquals(tm.firstEntry(), treeMap.firstEntry());
        assertEquals(tm.lastKey(), treeMap.lastKey());
        assertEquals(tm.lastEntry(), treeMap.lastEntry());
        assertEquals(tm.keySet(), treeMap.keySet());

        String key = new Integer(100).toString();
        assertEquals(tm.ceilingKey(key), treeMap.ceilingKey(key));
        assertEquals(tm.ceilingEntry(key), treeMap.ceilingEntry(key));
View Full Code Here

            treeMap.lastKey();
            fail("should throw NoSuchElementException");
        } catch (NoSuchElementException e) {
            // Expected
        }
        assertNull(treeMap.lastEntry());

        try {
            treeMap.ceilingKey(1);
        } catch (NoSuchElementException e) {
            // Expected
View Full Code Here

        TreeMap tm = new TreeMap();
        for(String s : separators) {
            tm.put(line.split(Pattern.quote(s)).length, s);
        }

        char separator = tm.lastEntry().getValue().toString().charAt(0);

        Crawler.logger.debug("Detected separator: " + separator);

        return separator;
    }
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.