org.crosswire.jsword.passage
Class KeyUtil

java.lang.Object
  extended by org.crosswire.jsword.passage.KeyUtil

public class KeyUtil
extends Object

.

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: KeyUtil.java,v 1.6 2004/08/30 09:27:07 joe Exp $
Author:
Joe Walker [joe at eireneh dot com]
See Also:
Licence

Field Summary
private static KeyFactory keyf
          How we create Passages
private static Logger log
          The log stream
 
Constructor Summary
private KeyUtil()
          Prevent instansiation
 
Method Summary
static Passage getPassage(Key key)
          Not all keys represent passages, but we ought to be able to get something close to a passage from anything that does passage like work.
static Verse getVerse(Key key)
          Not all keys represent verses, but we ought to be able to get something close to a verse from anything that does verse like work.
static void visit(Key key, KeyVisitor visitor)
          Walk through a tree visiting the nodes and branches in the tree
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

keyf

private static KeyFactory keyf
How we create Passages


log

private static final Logger log
The log stream

Constructor Detail

KeyUtil

private KeyUtil()
Prevent instansiation

Method Detail

visit

public static void visit(Key key,
                         KeyVisitor visitor)
Walk through a tree visiting the nodes and branches in the tree

Parameters:
key - The node tree to walk through
visitor - The visitor to notify whenever a node is found

getVerse

public static Verse getVerse(Key key)
Not all keys represent verses, but we ought to be able to get something close to a verse from anything that does verse like work.


getPassage

public static Passage getPassage(Key key)
Not all keys represent passages, but we ought to be able to get something close to a passage from anything that does passage like work. If you pass a null key into this method, you get a null Passage out.


Copyright ? 2003-2004