org.eclipse.ocl.examples.domain.utilities
Class ArrayIterable<T>

java.lang.Object
  extended by org.eclipse.ocl.examples.domain.utilities.ArrayIterable<T>
All Implemented Interfaces:
java.lang.Iterable<T>, IndexableIterable<T>

public class ArrayIterable<T>
extends java.lang.Object
implements IndexableIterable<T>

ArrayIterable provides an Iterable for an Array


Nested Class Summary
protected  class ArrayIterable.Iterator
           
 
Constructor Summary
ArrayIterable(T[] array)
           
ArrayIterable(T[] array, int firstIndex, int lastIndex)
           
 
Method Summary
 T get(int index)
           
 java.util.Iterator<T> iterator()
           
 int size()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArrayIterable

public ArrayIterable(T[] array)

ArrayIterable

public ArrayIterable(T[] array,
                     int firstIndex,
                     int lastIndex)
Method Detail

get

@NonNull
public T get(int index)
Specified by:
get in interface IndexableIterable<T>

iterator

public java.util.Iterator<T> iterator()
Specified by:
iterator in interface java.lang.Iterable<T>

size

public int size()
Specified by:
size in interface IndexableIterable<T>