A private class that calls a method from its outer class
Ok, so I have a class for "Extended Data Structure" (in this case, it's kind of a tree) So I included the Iterator as a private class. Thus, the iterator needs to implement a delete function to remove the last retuirned element.
now my ADT is already implementing a delete function, in which case there is very little (thinking about it, I don't think anything) to benefit from implementing a different delete function for an iterator.
since i need to call delete from my ADT
a sketch of my struture:
public class ADT {
...
private class ADT_Iterator impliments java.util.Itorator{
...
public void remove(){
//where I want to call the ADT remove function from
}
...
public void remove( Object paramFoo )
{
...
}
...
}
So just calling remove (FooInstance) won't work (right?) And this.remove (FooInstance) is the same thing.
what can I name? (and changing the name of the ADT delete function is not an option, as AD T must match the Interace which I want to mark to change)
I could get both of them to call the removeHelper function, I think ...
a source to share