Package java.util

Examples of java.util.Hashtable.keySet()


        new Integer(1), new Integer(102), new Integer(203) }));
    list.remove(remove1);
    list.remove(remove2);
    assertTrue("Wrong result", it.next().equals(list.get(0)));
    assertEquals("Wrong size", 1, map.size());
    assertTrue("Wrong contents", map.keySet().iterator().next().equals(
        list.get(0)));

    Map map2 = new Hashtable(101);
    map2.put(new Integer(1), "1");
    map2.put(new Integer(4), "4");
View Full Code Here


        list.get(0)));

    Map map2 = new Hashtable(101);
    map2.put(new Integer(1), "1");
    map2.put(new Integer(4), "4");
    Iterator it2 = map2.keySet().iterator();
    Integer remove3 = (Integer) it2.next();
    Integer next;
    if (remove3.intValue() == 1)
      next = new Integer(4);
    else
View Full Code Here

      next = new Integer(1);
    it2.hasNext();
    it2.remove();
    assertTrue("Wrong result 2", it2.next().equals(next));
    assertEquals("Wrong size 2", 1, map2.size());
    assertTrue("Wrong contents 2", map2.keySet().iterator().next().equals(
        next));
  }

  /**
   * @tests java.util.Hashtable#keySet()
View Full Code Here

          ht.remove(String.valueOf(i));
        }
      }
    };
    t1.start();
    Set set = ht.keySet();
    for (int i = 0; i < iterations; i++) {
      Iterator it = set.iterator();
      try {
        it.next();
        it.remove();
View Full Code Here

    // 0: "1"
    // 1: "12" -> "9" -> "2"
    Enumeration en = ht.elements();
    // cache the first entry
    en.hasMoreElements();
    Iterator it = ht.keySet().iterator();
    // this is mostly a copy of the test in test_elements_subtest0()
    // test removing with the iterator does not null the values
    while (it.hasNext()) {
      String key = (String) it.next();
      if ("12".equals(key) || "9".equals(key)) {
View Full Code Here

        }
      }// end while more entries
    }// end for all providers

    Provider provTest[] = null;
    Iterator it = allSupported.keySet().iterator();
    while (it.hasNext()) {
      String filterString = (String) it.next();
      try {
        provTest = Security.getProviders(filterString);
        int expected = ((Integer) allSupported.get(filterString))
View Full Code Here

     */
    public static ObjectName createObjectName(Map nameMap) {
        Hashtable objectNameMap = new Hashtable(nameMap);
        String type = (String) nameMap.get(J2EE_TYPE);
        if ("JVM".equals(type)) {
            objectNameMap.keySet().retainAll(Arrays.asList(new String[] {J2EE_TYPE, J2EE_NAME, "J2EEServer"}));
            objectNameMap.put("J2EEServer", DEFAULT_SERVER_NAME);
        } else if ("J2EEDomain".equals(type)) {
            //special case J2EEDomain gbean
            objectNameMap.clear();
            objectNameMap.put(J2EE_TYPE, "J2EEDomain");
View Full Code Here

     */
    public static ObjectName createObjectName(Map nameMap) {
        Hashtable objectNameMap = new Hashtable(nameMap);
        String type = (String) nameMap.get(J2EE_TYPE);
        if ("JVM".equals(type)) {
            objectNameMap.keySet().retainAll(Arrays.asList(new String[] {J2EE_TYPE, J2EE_NAME, "J2EEServer"}));
            objectNameMap.put("J2EEServer", DEFAULT_SERVER_NAME);
        } else if ("J2EEDomain".equals(type)) {
            //special case J2EEDomain gbean
            objectNameMap.clear();
            objectNameMap.put(J2EE_TYPE, "J2EEDomain");
View Full Code Here

            int psrOffset = usr.getPersistPointersOffset();

            PersistPtrHolder ptr = (PersistPtrHolder)Record.buildRecordAtOffset(docstream, psrOffset);
            lst.add(new Integer(psrOffset));
            Hashtable entries = ptr.getSlideLocationsLookup();
            for (Iterator it = entries.keySet().iterator(); it.hasNext(); ) {
                Integer id = (Integer)it.next();
                Integer offset = (Integer)entries.get(id);

                lst.add(offset);
                offset2id.put(offset, id);
View Full Code Here

                String key = (String)lists.next();
                str = str + "\n    " + "list name: " + key;
                Hashtable list = (Hashtable)_srcLists.get(key);
                if(list!=null)
                {
                    Object[] keys = (Object[])list.keySet().toArray();
                    for(int i=0; i<keys.length; i++)
                        str = str + "\n      " + keys[i]; // + "   xpath=" + list.get(keys[i]);
                }
            }
        }
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.