Exemplo n.º 1
0
 @Override
 public boolean add(T o) {
   final int hash = hasher.getHashCode(o);
   if (!map.containsKey(hash)) {
     map.put(hash, o);
     super.add(o);
     return true;
   } else {
     return false;
   }
 }
Exemplo n.º 2
0
 @Override
 public boolean remove(Object o) {
   final int hash = hasher.getHashCode(o);
   if (map.containsKey(hash)) {
     super.remove(map.get(hash));
     map.remove(hash);
     return true;
   } else {
     return false;
   }
 }
Exemplo n.º 3
0
 @Override
 public boolean contains(Object o) {
   return map.containsKey(hasher.getHashCode(o));
 }