public void testCollections261_2() {
    Flat3Map m = new Flat3Map();

    m.put(new Integer(2), new Integer(2));
    m.put(new Integer(1), new Integer(1));
    m.put(new Integer(0), new Integer(0));
    assertEquals(new Integer(2), m.remove(new Integer(2)));
    assertEquals(new Integer(1), m.remove(new Integer(1)));
    assertEquals(new Integer(0), m.remove(new Integer(0)));
  }
Exemple #2
0
 public void remove() {
   if (canRemove == false) {
     throw new IllegalStateException(AbstractHashedMap.REMOVE_INVALID);
   }
   parent.remove(getKey());
   nextIndex--;
   canRemove = false;
 }
Exemple #3
0
 public boolean remove(Object obj) {
   if (obj instanceof Map.Entry == false) {
     return false;
   }
   Map.Entry entry = (Map.Entry) obj;
   Object key = entry.getKey();
   boolean result = parent.containsKey(key);
   parent.remove(key);
   return result;
 }
Exemple #4
0
 public boolean remove(Object key) {
   boolean result = parent.containsKey(key);
   parent.remove(key);
   return result;
 }