Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.eireneh.bible.passage
Class PassageFactory  view PassageFactory download PassageFactory.java

java.lang.Object
  extended bycom.eireneh.bible.passage.PassageFactory

public class PassageFactory
extends java.lang.Object

A PassageFactory is in charge of creating Passages. The point of implementing it as a Factory is that the Passage interface may be implemented in different ways eached optimized for a different task. The user should not need to know which implementation is best at each task, so it asks a PassageFactory, to create what it thinks best.
Distribution Licence:
Project B 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, by writing to Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA, Or locally at the Licence link below.
The copyright to this program is held by it's authors.

Version:
$Id:$

Field Summary
private static int default_type
          The default type
static int MIX
          Optimize the Passage for a mix
static int SIZE
          Optimize the Passage for size
static int SPEED
          Optimize the Passage for speed
static int TALLY
          Optimize the Passage for tally operations
private static Passage whole
          The cached whole Bible passage
static int WRITE_SPEED
          Optimize the Passage for speed
 
Constructor Summary
PassageFactory()
           
 
Method Summary
static Passage createPassage()
          Create an empty Passage using the default type.
static Passage createPassage(int type)
          Create an empty Passage using a specified type.
static Passage createPassage(int type, java.lang.String name)
          Create an empty Passage using a specified type.
static Passage createPassage(java.lang.String name)
          Create an empty Passage using the default type.
static Passage getWholeBiblePassage()
          Create a Passage with all bits of the Bible set.
static void setDefaultPassage(int default_type)
          Set the default reference type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SPEED

public static final int SPEED
Optimize the Passage for speed

See Also:
Constant Field Values

WRITE_SPEED

public static final int WRITE_SPEED
Optimize the Passage for speed

See Also:
Constant Field Values

SIZE

public static final int SIZE
Optimize the Passage for size

See Also:
Constant Field Values

MIX

public static final int MIX
Optimize the Passage for a mix

See Also:
Constant Field Values

TALLY

public static final int TALLY
Optimize the Passage for tally operations

See Also:
Constant Field Values

whole

private static Passage whole
The cached whole Bible passage


default_type

private static int default_type
The default type

Constructor Detail

PassageFactory

public PassageFactory()
Method Detail

setDefaultPassage

public static void setDefaultPassage(int default_type)
Set the default reference type. Must be one of:
  • PassageFactory.SPEED
  • PassageFactory.WRITE_SPEED
  • PassageFactory.SIZE
  • PassageFactory.MIX
  • PassageFactory.TALLY


createPassage

public static Passage createPassage()
Create an empty Passage using the default type.


createPassage

public static Passage createPassage(java.lang.String name)
                             throws NoSuchVerseException
Create an empty Passage using the default type. And set the contents of the Passage using a string.


createPassage

public static Passage createPassage(int type)
Create an empty Passage using a specified type.


createPassage

public static Passage createPassage(int type,
                                    java.lang.String name)
                             throws NoSuchVerseException
Create an empty Passage using a specified type. And set the contents of the Passage using a string.


getWholeBiblePassage

public static Passage getWholeBiblePassage()
Create a Passage with all bits of the Bible set.