/** * Gets an immutable version of an {@link Iterator}. The returned object * will always throw an {@link UnsupportedOperationException} for * the {@link Iterator#remove} method. * * @param iterator the iterator to make immutable * @return an immutable version of the iterator */ public static Iterator unmodifiableIterator(Iterator iterator) { return UnmodifiableIterator.decorate(iterator); }
/** * Decorates the specified iterator such that it cannot be modified. * <p> * If the iterator is already unmodifiable it is returned directly. * * @param iterator the iterator to decorate * @throws IllegalArgumentException if the iterator is null */ public static Iterator decorate(Iterator iterator) { if (iterator == null) { throw new IllegalArgumentException("Iterator must not be null"); } if (iterator instanceof Unmodifiable) { return iterator; } return new UnmodifiableIterator(iterator); }
/** * Gets an immutable version of an {@link Iterator}. The returned object * will always throw an {@link UnsupportedOperationException} for * the {@link Iterator#remove} method. * * @param iterator the iterator to make immutable * @return an immutable version of the iterator */ public static Iterator unmodifiableIterator(Iterator iterator) { return UnmodifiableIterator.decorate(iterator); }
/** * Decorates the specified iterator such that it cannot be modified. * <p> * If the iterator is already unmodifiable it is returned directly. * * @param iterator the iterator to decorate * @throws IllegalArgumentException if the iterator is null */ public static Iterator decorate(Iterator iterator) { if (iterator == null) { throw new IllegalArgumentException("Iterator must not be null"); } if (iterator instanceof Unmodifiable) { return iterator; } return new UnmodifiableIterator(iterator); }
public Iterator iterator() { return UnmodifiableIterator.decorate(getCollection().iterator()); }
public Iterator iterator() { return UnmodifiableIterator.decorate(getCollection().iterator()); }
public Iterator iterator() { return UnmodifiableIterator.decorate(getCollection().iterator()); }
public Iterator iterator() { return UnmodifiableIterator.decorate(getCollection().iterator()); }
public Iterator iterator() { return UnmodifiableIterator.decorate(getCollection().iterator()); }
public Iterator iterator() { return UnmodifiableIterator.decorate(getCollection().iterator()); }
public Iterator iterator() { return UnmodifiableIterator.decorate(getCollection().iterator()); }
public Iterator iterator() { return UnmodifiableIterator.decorate(getCollection().iterator()); }
public Iterator iterator() { return UnmodifiableIterator.decorate(parent.keySet().iterator()); }
public Iterator iterator() { return UnmodifiableIterator.decorate(getCollection().iterator()); }
public Iterator iterator() { return UnmodifiableIterator.decorate(getCollection().iterator()); }
public Iterator iterator() { return UnmodifiableIterator.decorate(getCollection().iterator()); }
public Iterator iterator() { return UnmodifiableIterator.decorate(getCollection().iterator()); }
public Iterator iterator() { return UnmodifiableIterator.decorate(getCollection().iterator()); }
public Iterator iterator() { return UnmodifiableIterator.decorate(getCollection().iterator()); }
public Iterator iterator() { return UnmodifiableIterator.decorate(parent.keySet().iterator()); }