Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/ArrayIterator.java')
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/ArrayIterator.java73
1 files changed, 0 insertions, 73 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/ArrayIterator.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/ArrayIterator.java
deleted file mode 100644
index d0dd0f64e1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/ArrayIterator.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 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.utility.internal.iterators;
-
-import java.util.Arrays;
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- * An <code>ArrayIterator</code> provides an <code>Iterator</code>
- * for an array of objects of type E.
- */
-public class ArrayIterator<E>
- implements Iterator<E>
-{
- final E[] array; // private-protected
- int nextIndex; // private-protected
- private final int maxIndex;
-
- /**
- * Construct an iterator for the specified array.
- */
- public ArrayIterator(E... array) {
- this(array, 0, array.length);
- }
-
- /**
- * Construct an iterator for the specified array,
- * starting at the specified start index and continuing for
- * the specified length.
- */
- public ArrayIterator(E[] array, int start, int length) {
- if ((start < 0) || (start > array.length)) {
- throw new IllegalArgumentException("start: " + start); //$NON-NLS-1$
- }
- if ((length < 0) || (length > array.length - start)) {
- throw new IllegalArgumentException("length: " + length); //$NON-NLS-1$
- }
- this.array = array;
- this.nextIndex = start;
- this.maxIndex = start + length;
- }
-
- public boolean hasNext() {
- return this.nextIndex < this.maxIndex;
- }
-
- public E next() {
- if (this.hasNext()) {
- return this.array[this.nextIndex++];
- }
- throw new NoSuchElementException();
- }
-
- public void remove() {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, Arrays.toString(this.array));
- }
-
-}

Back to the top