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

Quick Search    Search Deep

com.eireneh.bible.book
Class Version  view Version download Version.java

java.lang.Object
  extended bycom.eireneh.bible.book.Version
Direct Known Subclasses:
BasicVersion

public abstract class Version
extends java.lang.Object

A Version represents a method of translating the Bible. All Bibles with the same Version should return identical text for any call to Bible.getText(VerseRange). The implication of this is that there may be many instances of the Version "NIV", as there are several different versions of the NIV - Original American-English, Anglicized, and Inclusive Language editions at least.

Versions like Strings must be compared using .equals() instead of ==. A Bible must have the ability to handle a version unknown to ProjectB. So Bibles must be able to add versions to the system, and the system must cope with versions that already exist.

I recommend that all Versions are created by the Bibles class and not using new Version() or new BasicVersion() because implementations of Bible should not all need to know all the ins and outs of the versions that they provide because that would mean lots of duplication of data - a centralized store of fine details would be better.

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:
D0.I0.T0

Field Summary
static int GUESS_WORDS
          We have no way of knowing exactly how many words there are in a Version ...
protected static java.lang.String SEPARATOR
          The name-edition separator
static int STATUS_COMMERCIAL
          Is the data sold for commercial profit
static int STATUS_COPYABLE
          Is the data freely redistributable
static int STATUS_FREE
          Does the data have a licence that permits free use
static int STATUS_PD
          If the data free of copyright restrictions
static int STATUS_UNKNOWN
          If the data of unknown distribution status
 
Constructor Summary
Version()
           
 
Method Summary
 boolean equals(java.lang.Object obj)
          Do the 2 versions have matching names and editions.
abstract  java.lang.String getEdition()
          The edition of this version, for example "Anglicised" (NIV), "Stephanus" (Greek).
abstract  java.util.Date getFirstPublished()
          The date of first publishing.
 java.lang.String getFullName()
          The full name including edition of the version, for example "New International Version, Anglicised".
abstract  java.lang.String getInitials()
          The initials of the version - how most people will know it, for example "NIV", "KJV"
abstract  java.net.URL getLicence()
          Not sure about this one - Do we need a way of getting at the dist.
abstract  java.lang.String getName()
          The name of the version, for example "King James Version" or "Bible in Basic English" or "Greek".
abstract  int getOpenness()
          Is this version sold for commercial profit like the NIV, or kept open like the NET version.
 int hashCode()
          Get a moderately unique id for this Object.
 boolean isSameFamily(Version version)
          Do the 2 versions have matching names.
 java.lang.String toString()
          Get a human readable version of this Version -just bounce to getFullName()
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

GUESS_WORDS

public static final int GUESS_WORDS
We have no way of knowing exactly how many words there are in a Version ...

See Also:
Constant Field Values

STATUS_UNKNOWN

public static final int STATUS_UNKNOWN
If the data of unknown distribution status

See Also:
Constant Field Values

STATUS_PD

public static final int STATUS_PD
If the data free of copyright restrictions

See Also:
Constant Field Values

STATUS_FREE

public static final int STATUS_FREE
Does the data have a licence that permits free use

See Also:
Constant Field Values

STATUS_COPYABLE

public static final int STATUS_COPYABLE
Is the data freely redistributable

See Also:
Constant Field Values

STATUS_COMMERCIAL

public static final int STATUS_COMMERCIAL
Is the data sold for commercial profit

See Also:
Constant Field Values

SEPARATOR

protected static final java.lang.String SEPARATOR
The name-edition separator

See Also:
Constant Field Values
Constructor Detail

Version

public Version()
Method Detail

getName

public abstract java.lang.String getName()
The name of the version, for example "King James Version" or "Bible in Basic English" or "Greek". In general it should be possible to deduce the initials from the name by removing all the non-capital letters.


getEdition

public abstract java.lang.String getEdition()
The edition of this version, for example "Anglicised" (NIV), "Stephanus" (Greek). For 2 versions to be equal both the name and the edition must be equal. In general the text returned by this method should not include the word "Edition"


getFullName

public java.lang.String getFullName()
The full name including edition of the version, for example "New International Version, Anglicised". The format is "name, edition"


equals

public boolean equals(java.lang.Object obj)
Do the 2 versions have matching names and editions.


hashCode

public int hashCode()
Get a moderately unique id for this Object.


isSameFamily

public boolean isSameFamily(Version version)
Do the 2 versions have matching names.


getInitials

public abstract java.lang.String getInitials()
The initials of the version - how most people will know it, for example "NIV", "KJV"


getFirstPublished

public abstract java.util.Date getFirstPublished()
The date of first publishing. This does not need to be accurate and 2 versions can be considered equal even if they have different first publishing dates for that reason. In general "1 Jan 1970" means published in 1970, and so on. A null return from this method is entirely valid if the date of first publishing is not known.


getOpenness

public abstract int getOpenness()
Is this version sold for commercial profit like the NIV, or kept open like the NET version.


getLicence

public abstract java.net.URL getLicence()
Not sure about this one - Do we need a way of getting at the dist. licence? Are we going to be able to tie it down to a single Version policy like this?


toString

public java.lang.String toString()
Get a human readable version of this Version -just bounce to getFullName()