List of usage examples for com.google.common.collect Iterators unmodifiableIterator
@Deprecated public static <T> UnmodifiableIterator<T> unmodifiableIterator(UnmodifiableIterator<T> iterator)
From source file:com.jeffplaisance.util.fingertree.IterableReverseIterables.java
public static <T> IterableReverseIterable<T> fromList(final List<T> list) { return new IterableReverseIterable<T>() { @Override/*www .j av a 2s . c o m*/ public Iterator<T> iterator() { return Iterators.unmodifiableIterator(list.iterator()); } @Override public Iterator<T> reverseIterator() { final ListIterator<T> iterator = list.listIterator(list.size()); return new Iterator<T>() { @Override public boolean hasNext() { return iterator.hasPrevious(); } @Override public T next() { return iterator.previous(); } @Override public void remove() { throw new UnsupportedOperationException(); } }; } }; }
From source file:com.yahoo.elide.datastores.hibernate3.ScrollableIterator.java
@Override public Iterator<T> iterator() { if (inUse) {/*from w w w .j a va 2 s . co m*/ throw new ConcurrentModificationException(); } if (!scroll.first()) { return Collections.emptyListIterator(); } inUse = true; hasNext = true; return Iterators.unmodifiableIterator(this); }
From source file:org.omnaest.utils.beans.autowired.AutowiredContainerUtils.java
/** * Returns a {@link AutowiredContainerDecorator} which prohibits modifications to the underlying {@link AutowiredContainer}. If * a modification access is tried a {@link UnsupportedOperationException} is thrown therefore.<br> * The {@link Iterator} will allow traversing but no {@link Iterator#remove()}.<br> * <br>//from w w w .j a v a 2 s . c om * If the give parameter is null, null is returned, too. * * @param autowiredContainer * @return */ public static <E> AutowiredContainer<E> unmodifiable(AutowiredContainer<E> autowiredContainer) { // AutowiredContainer<E> retval = null; // if (autowiredContainer != null) { retval = new AutowiredContainerDecorator<E>(autowiredContainer) { /* ********************************************** Constants ********************************************** */ private static final long serialVersionUID = -6875582761205350886L; /* ********************************************** Methods ********************************************** */ @Override public Iterator<E> iterator() { return Iterators.unmodifiableIterator(super.iterator()); } @Override public AutowiredContainer<E> put(E object) { throw new UnsupportedOperationException(); } @Override public AutowiredContainer<E> putAll(Iterable<E> iterable) { throw new UnsupportedOperationException(); } @Override public <O extends E> AutowiredContainer<E> put(O object, Class<? extends O>... types) { throw new UnsupportedOperationException(); } @Override public <O extends E> AutowiredContainer<E> remove(O object) { throw new UnsupportedOperationException(); } @Override public AutowiredContainer<E> removeAllHavingExactTypeOf(Class<? extends E> type) { throw new UnsupportedOperationException(); } }; } // return retval; }
From source file:org.jboss.errai.ioc.rebind.ioc.graph.impl.DependencyGraphImpl.java
@Override public Iterator<Injectable> iterator() { return Iterators.unmodifiableIterator(injectablesByName.values().iterator()); }
From source file:org.caleydo.core.view.opengl.layout2.basic.RadioController.java
@Override public Iterator<GLButton> iterator() { return Iterators.unmodifiableIterator(buttons.iterator()); }
From source file:com.complexible.common.openrdf.query.ImmutableBindingSet.java
/** * @inheritDoc */ @Override public Iterator<Binding> iterator() { return Iterators.unmodifiableIterator(super.iterator()); }
From source file:com.torodb.kvdocument.conversion.mongowp.values.LazyBsonKvArray.java
@Override public UnmodifiableIterator<KvValue<?>> iterator() { return Iterators.unmodifiableIterator(Iterators.transform(wrapped.iterator(), MongoWpConverter.FROM_BSON)); }
From source file:com.torodb.kvdocument.values.heap.ListKvArray.java
@Override public UnmodifiableIterator<KvValue<?>> iterator() { return Iterators.unmodifiableIterator(list.iterator()); }
From source file:com.torodb.kvdocument.values.heap.MapKvDocument.java
@Override public UnmodifiableIterator<DocEntry<?>> iterator() { return Iterators.unmodifiableIterator( Iterators.transform(map.entrySet().iterator(), KvDocument.FromEntryMap.INSTANCE)); }
From source file:com.torodb.torod.core.subdocument.values.heap.ListScalarArray.java
@Override public UnmodifiableIterator<ScalarValue<?>> iterator() { return Iterators.unmodifiableIterator(list.iterator()); }