org.crosswire.bibledesktop.passage
Class WholeBibleTreeNode

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

public final class WholeBibleTreeNode
extends Object
implements TreeNode

A PassageTreeNode extends TreeNode to Model a Passage.

Author:
Joe Walker [joe at eireneh dot com]
See Also:
for license details. The copyright to this program is held by it's authors.

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]
private static int LEVEL_BIBLE
           
private static int LEVEL_BOOK
           
private static int LEVEL_CHAPTER
           
private static int LEVEL_VERSE
           
private  TreeNode parent
          Our parent tree node
private  VerseRange range
          The range that this node refers to
private  NumberShaper shaper
          Change the number representation as needed
 
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 start 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

private static final int LEVEL_BIBLE
See Also:
Constant Field Values

LEVEL_BOOK

private static final int LEVEL_BOOK
See Also:
Constant Field Values

LEVEL_CHAPTER

private static final int LEVEL_CHAPTER
See Also:
Constant Field Values

LEVEL_VERSE

private static final int LEVEL_VERSE
See Also:
Constant Field Values

shaper

private NumberShaper shaper
Change the number representation as needed


range

private 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 start 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-2007