Hi Peter,
Is it an idea to write a "Wrapper" class that contains the Vector (or other
base class) then write your own methods to put and get the variables.
Something like:
public class WrapperClass (BaseClass base)
{
private BaseClass privateBaseClas s;
public Iterator getIterator()
{
Your code to return an Iterator;
}
public ArrayList getArryList()
{
Your code to return an ArrayList;
}
public Object getObject(Objec t key)
{
Your code to return the object belonging to key
}
......... etc ........
public WrapperClass(Ba seClass base)
{
privateWrapperC lass = base;
}
}
Then use it like:
WrapperClass wrapped = new WrapperClass(<y our base class object>)
for (Iterator i = wrapped.getIter ator(); i.hasNext();)
{
Do your stuff......
}
Hope it gives you ideas.....
Regards,
Frank.
"Peter Chatterton" <pe***@chattert on.name> wrote in message
news:8X******** **********@news 20.bellglobal.c om...
I have a class extending Vector, but I want it to extend another base
class that contains variables. Can I implement some interfaces to do the same
thing?
The following from the Vector API makes me think I'm out of luck:
public class Vector
extends AbstractList
implements List, Cloneable, Serializable
But I would appreciate another opinion.
Assuming I'm right, is this a feature or a flaw of Java?
Thanks,
Peter.