All pastes #445715 Raw Edit

contains method

public text v1 · immutable
·published 2007-04-18 01:33 UTC
rendered paste body
        public boolean contains(Object arg0) {
                int index = Math.abs(arg0.hashCode() % numBuckets);
                if (buckets[index] == null)
                        return false;
                LinkedList<Object> test = buckets[index];
                for (java.util.Iterator itr = test.iterator(); itr.hasNext();){
                        Object a = itr.next();
                        if (arg0.equals(a))
                                return true;
                }
                return false;
        }