diff options
Diffstat (limited to 'common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/iterables/SuperListIterableWrapper.java')
-rw-r--r-- | common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/iterables/SuperListIterableWrapper.java | 54 |
1 files changed, 0 insertions, 54 deletions
diff --git a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/iterables/SuperListIterableWrapper.java b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/iterables/SuperListIterableWrapper.java deleted file mode 100644 index 7abe433983..0000000000 --- a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/iterables/SuperListIterableWrapper.java +++ /dev/null @@ -1,54 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010, 2011 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 java.util.List; -import java.util.ListIterator; - -import org.eclipse.jpt.common.utility.internal.StringTools; -import org.eclipse.jpt.common.utility.internal.iterators.SuperListIteratorWrapper; - -/** - * Wrap a list iterable of elements of any sub-type of <code>E</code>, - * converting it into a <em>non-writable</em> list iterable of elements - * of type <code>E</code>. - * This shouldn't be a problem since the resulting list iterable's list - * iterator disables the methods that would put invalid elements in the list - * iterator's backing list (i.e. {@link SuperListIteratorWrapper#set(Object)} - * and {@link SuperListIteratorWrapper#add(Object)}). - * - * @param <E> the type of elements returned by the iterable's iterators - * - * @see SuperListIteratorWrapper - */ -public class SuperListIterableWrapper<E> - implements ListIterable<E> -{ - private final ListIterable<? extends E> iterable; - - - public <T extends E> SuperListIterableWrapper(List<T> list) { - this(new ListListIterable<T>(list)); - } - - public SuperListIterableWrapper(ListIterable<? extends E> iterable) { - super(); - this.iterable = iterable; - } - - public ListIterator<E> iterator() { - return new SuperListIteratorWrapper<E>(this.iterable.iterator()); - } - - @Override - public String toString() { - return StringTools.buildToStringFor(this, this.iterable); - } -} |