Package java.util

Examples of java.util.SortedMap.entrySet()


        final Object invalidKey;
       
        public TestTailMap(AbstractTestMap main) {
            super("SortedMap.TailMap", main);
            SortedMap sm = (SortedMap) main.makeFullMap();
            for (Iterator it = sm.entrySet().iterator(); it.hasNext();) {
                Map.Entry entry = (Map.Entry) it.next();
                this.subSortedKeys.add(entry.getKey());
                this.subSortedValues.add(entry.getValue());
            }
            this.fromKey = this.subSortedKeys.get(this.subSortedKeys.size() - SUBSIZE);
View Full Code Here


        final Object toKey;
       
        public TestSubMap(AbstractTestMap main) {
            super("SortedMap.SubMap", main);
            SortedMap sm = (SortedMap) main.makeFullMap();
            for (Iterator it = sm.entrySet().iterator(); it.hasNext();) {
                Map.Entry entry = (Map.Entry) it.next();
                this.subSortedKeys.add(entry.getKey());
                this.subSortedValues.add(entry.getValue());
            }
            this.fromKey = this.subSortedKeys.get(SUBSIZE);
View Full Code Here

    // from TestPredicatedMap
    //-----------------------------------------------------------------------
    public void testEntrySet() {
        SortedMap map = makeTestSortedMap();
        assertTrue("returned entryset should not be null",
            map.entrySet() != null);
        map = decorateMap(new TreeMap(), null, null);
        map.put("oneKey", "oneValue");
        assertTrue("returned entryset should contain one entry",
            map.entrySet().size() == 1);
        map = decorateMap(map, null, null);
View Full Code Here

        assertTrue("returned entryset should not be null",
            map.entrySet() != null);
        map = decorateMap(new TreeMap(), null, null);
        map.put("oneKey", "oneValue");
        assertTrue("returned entryset should contain one entry",
            map.entrySet().size() == 1);
        map = decorateMap(map, null, null);
    }
   
    public void testPut() {
        Map map = makeTestMap();
View Full Code Here

        Object first = it.next();
        Object second = it.next();
       
        int size = sm.size();
        SortedMap sub = sm.tailMap(fromKey);
        Set set = sub.entrySet();
        Iterator it2 = set.iterator();
        Object fromEntry = it2.next();
        Map.Entry firstEntry = cloneMapEntry((Map.Entry) it2.next());
        Map.Entry secondEntry = cloneMapEntry((Map.Entry) it2.next());
        assertEquals(true, sm.containsKey(first));
View Full Code Here

        Object second = it.next();
        Object toKey = it.next();
       
        int size = sm.size();
        SortedMap sub = sm.subMap(fromKey, toKey);
        Set set = sub.entrySet();
        assertEquals(3, set.size());
        Iterator it2 = set.iterator();
        Object fromEntry = it2.next();
        Map.Entry firstEntry = cloneMapEntry((Map.Entry) it2.next());
        Map.Entry secondEntry = cloneMapEntry((Map.Entry) it2.next());
View Full Code Here

        Object second = it.next();
        Object toKey = it.next();
       
        int size = sm.size();
        SortedMap sub = sm.headMap(toKey);
        Set set = sub.entrySet();
        assertEquals(2, sub.size());
        assertEquals(2, set.size());
       
        Iterator it2 = set.iterator();
        Map.Entry firstEntry = cloneMapEntry((Map.Entry) it2.next());
View Full Code Here

    public void testShouldReturnImmutableNullCollectionsForNullSortedMap() throws Exception {
        SortedMap map = (SortedMap)Null.object(SortedMap.class, getFactory());

        assertSame(Collections.EMPTY_SET, map.keySet());
        assertSame(Collections.EMPTY_LIST, map.values());
        assertSame(Collections.EMPTY_SET, map.entrySet());
    }

    public interface InterfaceWithInterfaceMethod {
        InterfaceWithInterfaceMethod getSubInterface();
    }
View Full Code Here

      getLog().debug("creating " + cmrBugs.size() + " CMR bugs");
      cmrBugManager.createCMRBugs(cmrBugs);
      getLog().debug("created " + cmrBugs.size() + " CMR bugs");

      Iterator i = cmrBugs.entrySet().iterator();
      while(i.hasNext())
      {
         Map.Entry entry = (Map.Entry)i.next();

         String[] parentIdAndDescription =
View Full Code Here

      }
     
      // Display the help menu to the player
      String spaces = "    ";
     
      for ( Iterator iter = cmdDisplay.entrySet().iterator() ; iter.hasNext() ; ) {
        Command cmd = (Command)( (Map.Entry)iter.next() ).getValue();
       
        // Format the output string
        StringBuffer output = new StringBuffer( cmd.getName().trim() );
        // Fill the output with some space
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.