A
Alexander Mueller
Hi
it sounds simple, but i want to do the following
I have two interfaces, IBrowseable and INode.
A member-function of IBrowseable, 'getChildren', returns
List<INode>-collections.
Now i want classes that implement IBrowseable
to return different kinds of lists, so they can return
a List of any class that implements INode - as long as
they hold a collection of this INode-type.
Now, how do i specify the type of list i want to be returned?
If i write:
List<INode> getChildren (INode nodetype);
I need an *object* of INode to be passed in, but i simply want
to denote a certain INode-implementation shall be returned
If i write:
List<INode> getChildren (Type nodetype);
that would be okay, but it accepts any types, so it is not exactly
okay. I know i could use an enum for all accepted types, but i think
there must be a built-in-way to simply denote the specific INode-
implementation is queried, without needing an instance of it.
Any hints?
Mfg,
Alex
it sounds simple, but i want to do the following
I have two interfaces, IBrowseable and INode.
A member-function of IBrowseable, 'getChildren', returns
List<INode>-collections.
Now i want classes that implement IBrowseable
to return different kinds of lists, so they can return
a List of any class that implements INode - as long as
they hold a collection of this INode-type.
Now, how do i specify the type of list i want to be returned?
If i write:
List<INode> getChildren (INode nodetype);
I need an *object* of INode to be passed in, but i simply want
to denote a certain INode-implementation shall be returned
If i write:
List<INode> getChildren (Type nodetype);
that would be okay, but it accepts any types, so it is not exactly
okay. I know i could use an enum for all accepted types, but i think
there must be a built-in-way to simply denote the specific INode-
implementation is queried, without needing an instance of it.
Any hints?
Mfg,
Alex