|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--de.rwth.utils.ArrayIterator
Creates an iterator from an array of iterator-capable Object. Each element is an array of objects, consisting of elements from the component iterators. The iterator goes over all possible combinations by traversing the first object first, second object second and so forth.
Field Summary | |
protected java.lang.Object[] |
elements
The next element return by next. |
protected boolean |
hasNext
true as long as there are Objects in this iterator. |
protected java.lang.reflect.Method[] |
iMeths
For each entry in objs , this array contains the Method
used to create an iterator. |
protected java.util.Iterator[] |
iterators
For each entry in objs , this array contains the current state of
the component iterator. |
protected java.lang.Object[] |
objs
The array of objects. |
Constructor Summary | |
ArrayIterator(java.lang.Object[] objs)
Creates a new ArrayIterator instance. |
|
ArrayIterator(java.lang.Object[] objs,
java.lang.String name)
Creates a new ArrayIterator instance. |
Method Summary | |
boolean |
hasNext()
Checks if there are more elements pending. |
protected java.util.Iterator |
iterator(int i)
Invokes the i-th iterator method without raising exceptions. |
static void |
main(java.lang.String[] args)
Mini test environment. |
java.lang.Object |
next()
Returns the next element, an array of elements of the components. |
void |
remove()
Not implemented. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.lang.Object[] objs
protected java.lang.reflect.Method[] iMeths
objs
, this array contains the Method
used to create an iterator.protected boolean hasNext
true
as long as there are Objects in this iterator.protected java.lang.Object[] elements
protected java.util.Iterator[] iterators
objs
, this array contains the current state of
the component iterator.Constructor Detail |
public ArrayIterator(java.lang.Object[] objs, java.lang.String name) throws java.lang.IllegalArgumentException
ArrayIterator
instance.objs
- an Object[]
value: The iterator-capable objects.name
- a String
value: The name of the methods used to create
the iterators.java.lang.IllegalArgumentException
- if this class does not have
Iterator
as unique super interface or if one of the
objs
is not iterator-capable via name
.public ArrayIterator(java.lang.Object[] objs) throws java.lang.IllegalArgumentException
ArrayIterator
instance.objs
- an Object[]
value: The iterator-capable objects, which
must have a method Iterator iterator()
.java.lang.IllegalArgumentException
- if this class does not have
Iterator
as unique super interface or if one of the
objs
is not iterator-capable via Iterator iterator()
.Method Detail |
protected java.util.Iterator iterator(int i)
i
- an int
valueIterator
valuepublic java.lang.Object next() throws java.util.NoSuchElementException
next
in interface java.util.Iterator
Object
valuejava.util.NoSuchElementException
- if there is no more element.public boolean hasNext()
hasNext
in interface java.util.Iterator
boolean
valuepublic void remove() throws java.lang.UnsupportedOperationException
remove
in interface java.util.Iterator
java.lang.UnsupportedOperationException
- alwayspublic static void main(java.lang.String[] args)
args
- a String[]
value
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |