Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/iterables/PeekableIterable.java')
-rw-r--r--common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/iterables/PeekableIterable.java56
1 files changed, 0 insertions, 56 deletions
diff --git a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/iterables/PeekableIterable.java b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/iterables/PeekableIterable.java
deleted file mode 100644
index ad381ee41c..0000000000
--- a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/iterables/PeekableIterable.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.common.utility.internal.iterables;
-
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterators.PeekableIterator;
-
-/**
- * A <code>PeekableIterable</code> wraps another {@link Iterable}
- * and returns an {@link PeekableIterator} that allows a
- * {@link PeekableIterator#peek() peek} at the next element to be
- * returned by {@link Iterator#next()}.
- * <p>
- * One, possibly undesirable, side-effect of using this iterator is that
- * the nested iterator's <code>next()</code> method will be invoked
- * <em>before</em> the peekable iterator's {@link Iterator#next()}
- * method is invoked. This is because the "next" element must be
- * pre-loaded for the {@link PeekableIterator#peek()} method.
- * This also prevents a peekable iterator from supporting the optional
- * {@link Iterator#remove()} method.
- *
- * @param <E> the type of elements returned by the iterable's iterator
- *
- * @see PeekableIterator
- */
-public class PeekableIterable<E>
- implements Iterable<E>
-{
- private final Iterable<? extends E> iterable;
-
- /**
- * Construct a peekable iterable that wraps the specified
- * iterable.
- */
- public PeekableIterable(Iterable<? extends E> iterable) {
- super();
- this.iterable = iterable;
- }
-
- public PeekableIterator<E> iterator() {
- return new PeekableIterator<E>(this.iterable);
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.iterable);
- }
-
-}

Back to the top