Let's say a Tree
class has in inner Node
class.
class Tree {
...
class Node {
...
}
}
I know that within the context of a Node
instance, the outer instance, or the "owner" of the Node
can be accessed using the qualified this
:
Tree.this.someAction();
I'm looking for the exact opposite of this: a way to refer to and iterate over all Node
s owned by a given Tree
object without keeping an explicit collection field in Tree
.
Is this even possible without reflection?