Examples of firstKey()


Examples of java.util.SortedMap.firstKey()

    public void testSortOrder() {
        SortedMap map = makeTestSortedMap(oneFactory);
        map.put("A""a");
        map.get("B"); // Entry with value "One" created
        map.put("C", "c");
        assertEquals("First key should be A", map.firstKey(), "A");
        assertEquals("Last key should be C", map.lastKey(), "C");
        assertEquals("First key in tail map should be B",
            map.tailMap("B").firstKey(), "B");
        assertEquals("Last key in head map should be B",
            map.headMap("C").lastKey(), "B");
View Full Code Here

Examples of java.util.SortedMap.firstKey()

            map.put("D", null);
            fail("Null value should raise IllegalArgument");
        } catch (IllegalArgumentException e) {
            // expected
        }
        assertEquals("First key should be A", map.firstKey(), "A");
        assertEquals("Last key should be C", map.lastKey(), "C");
        assertEquals("First key in tail map should be B",
            map.tailMap("B").firstKey(), "B");
        assertEquals("Last key in head map should be B",
            map.headMap("C").lastKey(), "B");
View Full Code Here

Examples of java.util.SortedMap.firstKey()

        // no tests I can think of
    }
   
    public void testFirstKey() {
        SortedMap sm = (SortedMap) makeFullMap();
        assertSame(sm.keySet().iterator().next(), sm.firstKey());
    }
   
    public void testLastKey() {
        SortedMap sm = (SortedMap) makeFullMap();
        Object obj = null;
View Full Code Here

Examples of java.util.SortedMap.firstKey()

             if (logger.isLoggable(Level.FINER)) {            
                 logger.finer(" Instance "+ server +" started at :"+ startTime);
             }
             map.put(startTime, server);
         }
         return (String) map.get(map.firstKey());
    }       
}
View Full Code Here

Examples of java.util.SortedMap.firstKey()

         assertEquals(((SortedMap)server.getAttribute(name, "Entries")).size(), 3);
         Date start2 = (Date)server.getAttribute(name, "RecordingStart");

         assertTrue(start1.equals(start2) || start1.before(start2));
         SortedMap values = (SortedMap)server.getAttribute(name, "Entries");
         PointTime point1 = (PointTime)values.firstKey();
         PointTime point2 = (PointTime)values.lastKey();
         assertTrue(point1.getDate().equals(point2.getDate()) || point1.getDate().before(point2.getDate()));

         // re start it
         server.invoke(name, "stop", null, null);
View Full Code Here

Examples of java.util.TreeMap.firstKey()

                }
            }
        }

        return matches.size() == 0
               ? null : (String) matches.get( matches.firstKey() );
    }

    /**
     * Grab lists of all root-level files and all directories
     * contained in the given archive.
View Full Code Here

Examples of java.util.TreeMap.firstKey()

        assertTrue("TreeMap answered incorrect comparator", reversedTreeMap
                .comparator() == comp);
        reversedTreeMap.put(new Integer(1).toString(), new Integer(1));
        reversedTreeMap.put(new Integer(2).toString(), new Integer(2));
        assertTrue("TreeMap does not use comparator (firstKey was incorrect)",
                reversedTreeMap.firstKey().equals(new Integer(2).toString()));
        assertTrue("TreeMap does not use comparator (lastKey was incorrect)",
                reversedTreeMap.lastKey().equals(new Integer(1).toString()));

    }
View Full Code Here

Examples of java.util.TreeMap.firstKey()

        reversedTreeMap.put(new Integer(2).toString(), new Integer(2));
        TreeMap anotherTreeMap = new TreeMap(reversedTreeMap);
        assertTrue("New tree map does not answer correct comparator",
                anotherTreeMap.comparator() == comp);
        assertTrue("TreeMap does not use comparator (firstKey was incorrect)",
                anotherTreeMap.firstKey().equals(new Integer(2).toString()));
        assertTrue("TreeMap does not use comparator (lastKey was incorrect)",
                anotherTreeMap.lastKey().equals(new Integer(1).toString()));

    }
View Full Code Here

Examples of java.util.TreeMap.firstKey()

        assertTrue("TreeMap answered incorrect comparator", reversedTreeMap
                .comparator() == comp);
        reversedTreeMap.put(new Integer(1).toString(), new Integer(1));
        reversedTreeMap.put(new Integer(2).toString(), new Integer(2));
        assertTrue("TreeMap does not use comparator (firstKey was incorrect)",
                reversedTreeMap.firstKey().equals(new Integer(2).toString()));
        assertTrue("TreeMap does not use comparator (lastKey was incorrect)",
                reversedTreeMap.lastKey().equals(new Integer(1).toString()));
    }

    /**
 
View Full Code Here

Examples of java.util.TreeMap.firstKey()

                }
            }
        }

        return matches.size() == 0
            ? null : (String) matches.get(matches.firstKey());
    }

    /**
     * Grab lists of all root-level files and all directories
     * contained in the given archive.
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.