i have a class called NonRepeatedDefaultMatrix
NonRepeatedDefaultMatrix has an inner class KeySet<E>
KeySet<E> inherits from HashSet<E>
KeySet<E> has an inner class KeySetIterator<E>
so, the inner-outer class tree looks like:
NonRepeatedDefaultMatrix
KeySet<E> inherits HashSet<E>
KeySetIterator<E>
note that these are inner classes, not static nested class
now the problem:
in a method in KeySetIterator i have a line where i am attempting to get a
reference to the iterator returned by HashSet's iterator method.
thus, if the line was written in a method in KeySet i would simply write:
Iterator<E> theIterator = super.iterator();
which works fine.
the equivalent line i write in a method in KeySetIterator is:
Iterator<E> theIterator = NonRepeatedDefaultMatrix.KeySet.super.iterator();
the error I get during compilation:
sourcepath/NonRepeatedDefaultMatrix.java:364: incompatible types
found : java.util.Iterator<E>
required: java.util.Iterator<E>
this.theIterator = NonRepeatedDefaultMatrix.KeySet.super.iterator();
obviously this error message is misleading as the types are most certainly
compatible!
i want the line to get the iterator returned by the HashSet's iterator()
implementation, not the KeySet's iterator() implementation.
this is necessary because the line in question is part of the
KeySetIterator's constructor, which is called by KeySet.iterator() - which
would obviously result in calling cycle.
anyone out there still managing to read this far down understand my
problem?
better yet... anyone know how i should do this?
thanks much!
murat
Murat Tasan - 29 Apr 2005 00:10 GMT
well - i figured out a better way around the problem. thanks anyhow.
> i have a class called NonRepeatedDefaultMatrix
>
[quoted text clipped - 51 lines]
>
> murat