public boolean isEmpty() { return key_chain.isEmpty(); }
@Override @SuppressWarnings("unchecked") public Iterator<E> iterator(E item) { if (firstItem == null || isEmpty()) { return (Iterator<E>) emptyIterator; } return new LinkIterator<E>(item); }
@Override @SuppressWarnings("unchecked") public Iterator<E> iterator() { if (firstItem == null || isEmpty()) { return (Iterator<E>) emptyIterator; } return new LinkIterator<E>(firstItem); }
/** * <p> * Returns an iterator ranging from <code>head</code> to <code>tail</code>, inclusive. * </p> * * <p> * If <code>tail</code> is the element immediately preceding <code>head</code> in this <code>HashChain</code>, the returned * iterator will iterate 0 times (a special case to allow the specification of an empty range of elements). Otherwise if * <code>tail</code> is not one of the elements following <code>head</code>, the returned iterator will iterate past the * end of the <code>HashChain</code>, provoking a {@link NoSuchElementException}. * </p> * * @throws NoSuchElementException * if <code>head</code> is not an element of the chain. */ @Override @SuppressWarnings("unchecked") public Iterator<E> iterator(E head, E tail) { if (firstItem == null || isEmpty()) { return (Iterator<E>) emptyIterator; } if (head != null && this.getPredOf(head) == tail) { return (Iterator<E>) emptyIterator; } return new LinkIterator<E>(head, tail); }
kc.remove(key); if (kc.isEmpty()) { value_chain.remove(old_value); back_map.remove(old_value);
public boolean isEmpty() { return key_chain.isEmpty(); }
public boolean isEmpty() { return key_chain.isEmpty(); }
kc.remove( key); if (kc.isEmpty()) { value_chain.remove( old_value); back_map.remove( old_value);
kc.remove( key); if (kc.isEmpty()) { value_chain.remove( old_value); back_map.remove( old_value);