public boolean insert(E x) { FHlinkedList<E> theList = mLists[myHash(x)]; if (theList.contains(x)) return false; // not found so we insert theList.addLast(x); // check load factor if (++mSize > mMaxLambda * mTableSize) rehash(); return true; }
public boolean remove(E x) { ListIterator<E> iter; FHlinkedList<E> theList = mLists[myHash(x)]; // do not use contains() because it involves two passes through list for (iter = theList.listIterator(); iter.hasNext(); ) if (x.equals(iter.next())) { iter.remove(); mSize--; return true; } // not found return false; }
public boolean contains(E x) { FHlinkedList<E> theList = mLists[myHash(x)]; return theList.contains(x); }