Package java.util

Examples of java.util.IdentityHashMap.containsKey()


                                } else {
                                    // Assume we moved down unless the object that was
                                    // here before is directly beside us.
                                    Object oldObject = oldListIndexValue.get(new Integer(index));
                               
                                    if (newListValueIndex.containsKey(oldObject)) {
                                        if ((((Integer) newListValueIndex.get(oldObject)).intValue() - index) > 1) {
                                            moved = false; // Assume the old object moved up.
                                            --offset;
                                        }
                                    }
View Full Code Here


            FragmentInfo fi = (FragmentInfo) it.next();
            boolean overlap = false;
            Iterator fit = fi.iterator();
            while (fit.hasNext() && !overlap) {
                TermVectorOffsetInfo oi = (TermVectorOffsetInfo) fit.next();
                if (offsetInfos.containsKey(oi)) {
                    overlap = true;
                }
            }
            if (overlap) {
                it.remove();
View Full Code Here

      String wbName = workbookNames[i];
      WorkbookEvaluator wbEval = evaluators[i];
      if (m.containsKey(wbName)) {
        throw new IllegalArgumentException("Duplicate workbook name '" + wbName + "'");
      }
      if (uniqueEvals.containsKey(wbEval)) {
        String msg = "Attempted to register same workbook under names '"
          + uniqueEvals.get(wbEval) + "' and '" + wbName + "'";
        throw new IllegalArgumentException(msg);
      }
      uniqueEvals.put(wbEval, wbName);
View Full Code Here

                            if (oldIndex < index) {
                                ++offset;   
                            } else {
                                for (int i = oldIndex - 1; i >= index; i--) {
                                    Object oldObject = oldListIndexValue.get(Integer.valueOf(i));
                                    if (newListValueIndex.containsKey(oldObject)) {
                                        ++movedObjects;
                                    } else {
                                        ++deletedObjects;
                                    }
                                }
View Full Code Here

                                } else {
                                    // Assume we moved down unless the object that was
                                    // here before is directly beside us.
                                    Object oldObject = oldListIndexValue.get(Integer.valueOf(index));
                               
                                    if (newListValueIndex.containsKey(oldObject)) {
                                        if (((newListValueIndex.get(oldObject)).intValue() - index) > 1) {
                                            moved = false; // Assume the old object moved up.
                                            --offset;
                                        }
                                    }
View Full Code Here

        .containsKey(new Integer(23).toString()));
    assertTrue("Returned true for invalid key", !hm.containsKey("KKDKDKD"));

    IdentityHashMap m = new IdentityHashMap();
    m.put(null, "test");
    assertTrue("Failed with null key", m.containsKey(null));
    assertTrue("Failed with missing key matching null hash", !m
        .containsKey(new Integer(0)));
  }

  /**
 
View Full Code Here

    assertTrue("Returned true for invalid key", !hm.containsKey("KKDKDKD"));

    IdentityHashMap m = new IdentityHashMap();
    m.put(null, "test");
    assertTrue("Failed with null key", m.containsKey(null));
    assertTrue("Failed with missing key matching null hash", !m
        .containsKey(new Integer(0)));
  }

  /**
   * @tests java.util.IdentityHashMap#containsValue(java.lang.Object)
View Full Code Here

    map.put(key, value);

    result = vals.remove(key);
    assertTrue("TestB. removed entries incorrectly", map.size() == 11
        && !result);
    assertTrue("TestB. removed key incorrectly", map.containsKey(key));
    assertTrue("TestB. removed value incorrectly", map.containsValue(value));

    result = vals.remove(value);
    assertTrue("TestB. Did not remove entry as expected", map.size() == 10
        && result);
View Full Code Here

    assertTrue("TestB. removed value incorrectly", map.containsValue(value));

    result = vals.remove(value);
    assertTrue("TestB. Did not remove entry as expected", map.size() == 10
        && result);
    assertTrue("TestB. Did not remove key as expected", !map
        .containsKey(key));
    assertTrue("TestB. Did not remove value as expected", !map
        .containsValue(value));

    vals.clear();
View Full Code Here

    int size = newset.size();
    assertTrue("keyset and newset don't have same size",
        newset.size() == size);
    assertTrue("element is in newset ", !newset.contains(key));
    assertTrue("element not removed from keyset", !set.contains(key));
    assertTrue("element not removed from map", !map.containsKey(key));

    assertTrue("newset and keyset do not have same elements 1", newset
        .equals(set));
    assertTrue("newset and keyset do not have same elements 2", set
        .equals(newset));
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.