org.crosswire.bibledesktop.passage
Class WholeBibleTreeNode

java.lang.Object
  extended by org.crosswire.bibledesktop.passage.WholeBibleTreeNode
All Implemented Interfaces:
TreeNode

public class WholeBibleTreeNode
extends Object
implements TreeNode

A PassageTreeNode extends TreeNode to Model a Passage.

Distribution Licence:
JSword is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2 as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
The License is available on the internet here, or by writing to: Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
The copyright to this program is held by it's authors.

Version:
$Id: WholeBibleTreeNode.java,v 1.5 2005/03/19 18:45:12 dmsmith Exp $
Author:
Joe Walker [joe at eireneh dot com]
See Also:
Licence

Nested Class Summary
 class WholeBibleTreeNode.WholeBibleEnumeration
          Iterate over the Books
 
Field Summary
private  int level
          The level of this node one of: LEVEL_[BIBLE|BOOK|CHAPTER|VERSE]
protected static int LEVEL_BIBLE
           
protected static int LEVEL_BOOK
           
protected static int LEVEL_CHAPTER
           
protected static int LEVEL_VERSE
           
private  TreeNode parent
          Our parent tree node
protected  VerseRange range
          The range that this node refers to
 
Constructor Summary
private WholeBibleTreeNode(TreeNode parent, VerseRange range, int level)
          This constructor is for when we are really a BookTreeNode
 
Method Summary
 Enumeration children()
           
 boolean getAllowsChildren()
           
 TreeNode getChildAt(int i)
          Returns the child TreeNode at index i
 int getChildCount()
          Returns the number of children TreeNodes the receiver contains.
 int getIndex(TreeNode node)
          Returns the index of node in the receivers children.
protected static WholeBibleTreeNode getNode(TreeNode parent, int b, int c, int v)
          We could do some caching here if needs be.
 TreeNode getParent()
           
static WholeBibleTreeNode getRootNode()
          The starrt point for all WholeBibleTreeNodes.
 VerseRange getVerseRange()
          The current Passage number
 boolean isLeaf()
           
 String toString()
          How we appear in the Tree
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

LEVEL_BIBLE

protected static final int LEVEL_BIBLE
See Also:
Constant Field Values

LEVEL_BOOK

protected static final int LEVEL_BOOK
See Also:
Constant Field Values

LEVEL_CHAPTER

protected static final int LEVEL_CHAPTER
See Also:
Constant Field Values

LEVEL_VERSE

protected static final int LEVEL_VERSE
See Also:
Constant Field Values

range

protected VerseRange range
The range that this node refers to


parent

private TreeNode parent
Our parent tree node


level

private int level
The level of this node one of: LEVEL_[BIBLE|BOOK|CHAPTER|VERSE]

Constructor Detail

WholeBibleTreeNode

private WholeBibleTreeNode(TreeNode parent,
                           VerseRange range,
                           int level)
This constructor is for when we are really a BookTreeNode

Method Detail

getRootNode

public static WholeBibleTreeNode getRootNode()
The starrt point for all WholeBibleTreeNodes.


getNode

protected static WholeBibleTreeNode getNode(TreeNode parent,
                                            int b,
                                            int c,
                                            int v)
We could do some caching here if needs be.


getVerseRange

public VerseRange getVerseRange()
The current Passage number


getParent

public TreeNode getParent()
Specified by:
getParent in interface TreeNode
See Also:
TreeNode.getParent()

getAllowsChildren

public boolean getAllowsChildren()
Specified by:
getAllowsChildren in interface TreeNode
See Also:
TreeNode.getAllowsChildren()

isLeaf

public boolean isLeaf()
Specified by:
isLeaf in interface TreeNode
See Also:
TreeNode.isLeaf()

toString

public String toString()
How we appear in the Tree

Overrides:
toString in class Object

getChildAt

public TreeNode getChildAt(int i)
Returns the child TreeNode at index i

Specified by:
getChildAt in interface TreeNode

getChildCount

public int getChildCount()
Returns the number of children TreeNodes the receiver contains.

Specified by:
getChildCount in interface TreeNode

getIndex

public int getIndex(TreeNode node)
Returns the index of node in the receivers children. If the receiver does not contain node, -1 will be returned.

Specified by:
getIndex in interface TreeNode

children

public Enumeration children()
Specified by:
children in interface TreeNode
See Also:
TreeNode.children()

Copyright ? 2003-2004