[jsword-devel] Keys and Passages
dmsmith555 at yahoo.com
Sat Jul 17 04:38:11 MST 2004
I think that it may be better to have the tree be separate altogether
from Key. And I think that there is no need for a Key to know where it
stands in a tree or that it is in a tree.
For example, in DefaultMutableTreeNode, there is a getUserObject which
holds whatever you want it to. And toString is called on it to get the
text of the node for a tree display.
I am thinking that you may want two different kinds of user objects. One
that labels a collection of Keys and one for the Key itself. A
traversal interface, if needed, would know the abstract nature of a tree
Joe Walker wrote:
> I've refactored KeyList and Key into a combined Key type, and although
> there were a few points where I thought "This is too big" it has worked
> out OK.
> While I'm at it I'm making Passage and Key more similar, which reduces
> the complexity of things quite a bit.
> Now it occurs to me that while we are making Key be a more standard tree
> structure, there are ways in which it is decidedly not tree like. With a
> tree I can dig down and find a node and then add child nodes to that
> node. Thinking about Biblical references or dictionaries, though we are
> not like that. I can dig down and get the Gen 1 node, but what if I add
> "Mat 1" to that node?
> I think the answer is that the points in our node tree have built-in
> knowledge about their position within the tree (not normal behavior for
> a tree node) AND the only mutable node is the root node.
> Do we need to separate out Key into RootKey and ImmutableChildKey? (I'm
> sure there are better names)
> Hope to check in soon.
> jsword-devel mailing list
> jsword-devel at crosswire.org
More information about the jsword-devel