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
private static class WholeBibleTreeNode.Level
          Levels at which this node stands.
private  class WholeBibleTreeNode.WholeBibleEnumeration
          Iterate over the Books
 
Field Summary
private  WholeBibleTreeNode.Level level
          The level of this node one of: LEVEL_[BIBLE|BOOK|CHAPTER|VERSE]
private  TreeNode parent
          Our parent tree node
private  org.crosswire.jsword.passage.VerseRange range
          The range that this node refers to
private  org.crosswire.common.icu.NumberShaper shaper
          Change the number representation as needed
private  org.crosswire.jsword.versification.Versification v11n
           
 
Constructor Summary
private WholeBibleTreeNode(TreeNode parent, org.crosswire.jsword.passage.VerseRange range, WholeBibleTreeNode.Level level)
          This constructor is for when we are really a BookTreeNode
 
Method Summary
 Enumeration<TreeNode> 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, org.crosswire.jsword.versification.BibleBook 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.
 org.crosswire.jsword.passage.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

v11n

private org.crosswire.jsword.versification.Versification v11n

shaper

private org.crosswire.common.icu.NumberShaper shaper
Change the number representation as needed


range

private org.crosswire.jsword.passage.VerseRange range
The range that this node refers to


parent

private TreeNode parent
Our parent tree node


level

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

Constructor Detail

WholeBibleTreeNode

private WholeBibleTreeNode(TreeNode parent,
                           org.crosswire.jsword.passage.VerseRange range,
                           WholeBibleTreeNode.Level 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,
                                            org.crosswire.jsword.versification.BibleBook b,
                                            int c,
                                            int v)
We could do some caching here if needs be.


getVerseRange

public org.crosswire.jsword.passage.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, 0 will be returned.

Specified by:
getIndex in interface TreeNode

children

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

Copyright ยจ 2003-2013