[jsword-svn] r2222 - in trunk: bibledesktop/src/main/java/org/crosswire/bibledesktop/passage jsword/src/main/java/org/crosswire/jsword/book jsword/src/main/java/org/crosswire/jsword/book/basic jsword/src/main/java/org/crosswire/jsword/book/readings jsword/src/main/java/org/crosswire/jsword/book/sword jsword/src/main/java/org/crosswire/jsword/passage jsword/src/main/java/org/crosswire/jsword/versification jsword/src/main/java/org/crosswire/jsword/versification/system

dmsmith at crosswire.org dmsmith at crosswire.org
Wed Jan 25 15:11:28 MST 2012


Author: dmsmith
Date: 2012-01-25 15:11:28 -0700 (Wed, 25 Jan 2012)
New Revision: 2222

Added:
   trunk/jsword/src/main/java/org/crosswire/jsword/book/ReferenceSystem.java
Removed:
   trunk/jsword/src/main/java/org/crosswire/jsword/versification/ReferenceSystem.java
Modified:
   trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/passage/WholeBibleTreeNode.java
   trunk/jsword/src/main/java/org/crosswire/jsword/book/basic/AbstractPassageBook.java
   trunk/jsword/src/main/java/org/crosswire/jsword/book/readings/ReadingsBook.java
   trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/SwordDictionary.java
   trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/SwordGenBook.java
   trunk/jsword/src/main/java/org/crosswire/jsword/passage/AbstractPassage.java
   trunk/jsword/src/main/java/org/crosswire/jsword/passage/VerseRange.java
   trunk/jsword/src/main/java/org/crosswire/jsword/versification/BibleBook.java
   trunk/jsword/src/main/java/org/crosswire/jsword/versification/BibleBookList.java
   trunk/jsword/src/main/java/org/crosswire/jsword/versification/BibleInfo.java
   trunk/jsword/src/main/java/org/crosswire/jsword/versification/Versification.java
   trunk/jsword/src/main/java/org/crosswire/jsword/versification/system/SystemCatholic.java
   trunk/jsword/src/main/java/org/crosswire/jsword/versification/system/SystemCatholic2.java
   trunk/jsword/src/main/java/org/crosswire/jsword/versification/system/SystemGerman.java
   trunk/jsword/src/main/java/org/crosswire/jsword/versification/system/SystemKJV.java
   trunk/jsword/src/main/java/org/crosswire/jsword/versification/system/SystemKJVA.java
   trunk/jsword/src/main/java/org/crosswire/jsword/versification/system/SystemLeningrad.java
   trunk/jsword/src/main/java/org/crosswire/jsword/versification/system/SystemLuther.java
   trunk/jsword/src/main/java/org/crosswire/jsword/versification/system/SystemMT.java
   trunk/jsword/src/main/java/org/crosswire/jsword/versification/system/SystemNRSV.java
   trunk/jsword/src/main/java/org/crosswire/jsword/versification/system/SystemNRSVA.java
   trunk/jsword/src/main/java/org/crosswire/jsword/versification/system/SystemSynodal.java
   trunk/jsword/src/main/java/org/crosswire/jsword/versification/system/SystemSynodalP.java
   trunk/jsword/src/main/java/org/crosswire/jsword/versification/system/SystemVulg.java
   trunk/jsword/src/main/java/org/crosswire/jsword/versification/system/Versifications.java
Log:
cleanup of comments, refactoring, added getAllVerses to Versification.

Modified: trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/passage/WholeBibleTreeNode.java
===================================================================
--- trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/passage/WholeBibleTreeNode.java	2012-01-25 21:32:57 UTC (rev 2221)
+++ trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/passage/WholeBibleTreeNode.java	2012-01-25 22:11:28 UTC (rev 2222)
@@ -45,14 +45,15 @@
      * The start point for all WholeBibleTreeNodes.
      */
     public static WholeBibleTreeNode getRootNode() {
-        return new WholeBibleTreeNode(null, VerseRange.getWholeBibleVerseRange(), Level.BIBLE);
+        Versification v11n = Versifications.instance().getVersification("KJV");
+        return new WholeBibleTreeNode(null, v11n.getAllVerses(), Level.BIBLE);
     }
 
     /**
      * We could do some caching here if needs be.
      */
     protected static WholeBibleTreeNode getNode(TreeNode parent, BibleBook b, int c, int v) {
-        Versification rs = Versifications.instance().getVersification("KJV");
+        Versification v11n = Versifications.instance().getVersification("KJV");
         Verse start = null;
         Verse end = null;
         Level thislevel = Level.BOOK;
@@ -61,13 +62,13 @@
             assert false : b;
         } else if (c == -1) {
             thislevel = Level.BOOK;
-            int ec = rs.getLastChapter(b);
-            int ev = rs.getLastVerse(b, ec);
+            int ec = v11n.getLastChapter(b);
+            int ev = v11n.getLastVerse(b, ec);
             start = new Verse(b, 0, 0);
             end = new Verse(b, ec, ev);
         } else if (v == -1) {
             thislevel = Level.CHAPTER;
-            int ev = rs.getLastVerse(b, c);
+            int ev = v11n.getLastVerse(b, c);
             start = new Verse(b, c, 0);
             end = new Verse(b, c, ev);
         } else {
@@ -76,7 +77,7 @@
             end = start;
         }
 
-        VerseRange rng = new VerseRange(rs, start, end);
+        VerseRange rng = new VerseRange(v11n, start, end);
         return new WholeBibleTreeNode(parent, rng, thislevel);
     }
 

Copied: trunk/jsword/src/main/java/org/crosswire/jsword/book/ReferenceSystem.java (from rev 2221, trunk/jsword/src/main/java/org/crosswire/jsword/versification/ReferenceSystem.java)
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/book/ReferenceSystem.java	                        (rev 0)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/book/ReferenceSystem.java	2012-01-25 22:11:28 UTC (rev 2222)
@@ -0,0 +1,33 @@
+/**
+ * Distribution License:
+ * JSword is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License, version 2.1 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 Lesser General Public License for more details.
+ *
+ * The License is available on the internet at:
+ *       http://www.gnu.org/copyleft/lgpl.html
+ * or by writing to:
+ *      Free Software Foundation, Inc.
+ *      59 Temple Place - Suite 330
+ *      Boston, MA 02111-1307, USA
+ *
+ * Copyright: 2012
+ *     The copyright to this program is held by it's authors.
+ *
+ * ID: $Id: org.eclipse.jdt.ui.prefs 1178 2006-11-06 12:48:02Z dmsmith $
+ */
+package org.crosswire.jsword.book;
+
+/**
+ * A ReferenceSystem is a marker interface.
+ *
+ * @see gnu.lgpl.License for license details.<br>
+ *      The copyright to this program is held by it's authors.
+ * @author DM Smith [dmsmith555 at yahoo dot com]
+ */
+public interface ReferenceSystem {
+
+}

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/book/basic/AbstractPassageBook.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/book/basic/AbstractPassageBook.java	2012-01-25 21:32:57 UTC (rev 2221)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/book/basic/AbstractPassageBook.java	2012-01-25 22:11:28 UTC (rev 2222)
@@ -211,7 +211,7 @@
     }
 
     /* (non-Javadoc)
-     * @see org.crosswire.jsword.passage.KeyFactory#getKey(org.crosswire.jsword.versification.ReferenceSystem, java.lang.String)
+     * @see org.crosswire.jsword.passage.KeyFactory#getKey(java.lang.String)
      */
     public final Key getKey(String text) throws NoSuchKeyException {
         return PassageKeyFactory.instance().getKey(Versifications.instance().getVersification(versification), text);

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/book/readings/ReadingsBook.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/book/readings/ReadingsBook.java	2012-01-25 21:32:57 UTC (rev 2221)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/book/readings/ReadingsBook.java	2012-01-25 22:11:28 UTC (rev 2222)
@@ -50,7 +50,6 @@
 import org.crosswire.jsword.passage.PreferredKey;
 import org.crosswire.jsword.passage.RestrictionType;
 import org.crosswire.jsword.passage.SetKeyList;
-import org.crosswire.jsword.versification.ReferenceSystem;
 import org.crosswire.jsword.versification.system.Versifications;
 import org.jdom.Content;
 import org.jdom.Element;
@@ -198,13 +197,6 @@
     }
 
     /* (non-Javadoc)
-     * @see org.crosswire.jsword.passage.KeyFactory#getValidKey(org.crosswire.jsword.versification.ReferenceSystem, java.lang.String)
-     */
-    public Key getValidKey(ReferenceSystem referenceSystem, String name) {
-        return getValidKey(name);
-    }
-
-    /* (non-Javadoc)
      * @see org.crosswire.jsword.book.Book#getValidKey(java.lang.String)
      */
     public Key getValidKey(String name) {
@@ -216,13 +208,6 @@
     }
 
     /* (non-Javadoc)
-     * @see org.crosswire.jsword.passage.KeyFactory#getKey(org.crosswire.jsword.versification.ReferenceSystem, java.lang.String)
-     */
-    public Key getKey(ReferenceSystem referenceSystem, String name) throws NoSuchKeyException {
-        return getKey(name);
-    }
-
-    /* (non-Javadoc)
      * @see org.crosswire.jsword.book.Book#getKey(java.lang.String)
      */
     public Key getKey(String name) throws NoSuchKeyException {
@@ -232,13 +217,6 @@
     }
 
     /* (non-Javadoc)
-     * @see org.crosswire.jsword.passage.KeyFactory#getGlobalKeyList(org.crosswire.jsword.versification.ReferenceSystem)
-     */
-    public Key getGlobalKeyList(ReferenceSystem referenceSystem) {
-        return getGlobalKeyList();
-    }
-
-    /* (non-Javadoc)
      * @see org.crosswire.jsword.book.Book#getGlobalKeyList()
      */
     public Key getGlobalKeyList() {
@@ -246,13 +224,6 @@
     }
 
     /* (non-Javadoc)
-     * @see org.crosswire.jsword.passage.KeyFactory#createEmptyKeyList(org.crosswire.jsword.versification.ReferenceSystem)
-     */
-    public Key createEmptyKeyList(ReferenceSystem referenceSystem) {
-        return createEmptyKeyList();
-    }
-
-    /* (non-Javadoc)
      * @see org.crosswire.jsword.book.Book#createEmptyKeyList()
      */
     public Key createEmptyKeyList() {

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/SwordDictionary.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/SwordDictionary.java	2012-01-25 21:32:57 UTC (rev 2221)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/SwordDictionary.java	2012-01-25 22:11:28 UTC (rev 2222)
@@ -36,7 +36,6 @@
 import org.crosswire.jsword.passage.DefaultLeafKeyList;
 import org.crosswire.jsword.passage.Key;
 import org.crosswire.jsword.passage.NoSuchKeyException;
-import org.crosswire.jsword.versification.ReferenceSystem;
 import org.jdom.Content;
 import org.jdom.Element;
 
@@ -123,13 +122,6 @@
     }
 
     /* (non-Javadoc)
-     * @see org.crosswire.jsword.passage.KeyFactory#getGlobalKeyList(org.crosswire.jsword.versification.ReferenceSystem)
-     */
-    public Key getGlobalKeyList(ReferenceSystem referenceSystem) {
-        return getGlobalKeyList();
-    }
-
-    /* (non-Javadoc)
      * @see org.crosswire.jsword.book.Book#getGlobalKeyList()
      */
     public Key getGlobalKeyList() {
@@ -139,13 +131,6 @@
     }
 
     /* (non-Javadoc)
-     * @see org.crosswire.jsword.passage.KeyFactory#getValidKey(org.crosswire.jsword.versification.ReferenceSystem, java.lang.String)
-     */
-    public Key getValidKey(ReferenceSystem referenceSystem, String name) {
-        return getValidKey(name);
-    }
-
-    /* (non-Javadoc)
      * @see org.crosswire.jsword.book.Book#getValidKey(java.lang.String)
      */
     public Key getValidKey(String name) {
@@ -157,13 +142,6 @@
     }
 
     /* (non-Javadoc)
-     * @see org.crosswire.jsword.passage.KeyFactory#getKey(org.crosswire.jsword.versification.ReferenceSystem, java.lang.String)
-     */
-    public Key getKey(ReferenceSystem referenceSystem, String text) throws NoSuchKeyException {
-        return getKey(text);
-    }
-
-    /* (non-Javadoc)
      * @see org.crosswire.jsword.book.Book#getKey(java.lang.String)
      */
     public Key getKey(String text) throws NoSuchKeyException {
@@ -180,12 +158,8 @@
     }
 
     /* (non-Javadoc)
-     * @see org.crosswire.jsword.passage.KeyFactory#createEmptyKeyList(org.crosswire.jsword.versification.ReferenceSystem)
+     * @see org.crosswire.jsword.book.Book#createEmptyKeyList()
      */
-    public Key createEmptyKeyList(ReferenceSystem referenceSystem) {
-        return createEmptyKeyList();
-    }
-
     public Key createEmptyKeyList() {
         return new DefaultKeyList();
     }

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/SwordGenBook.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/SwordGenBook.java	2012-01-25 21:32:57 UTC (rev 2221)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/SwordGenBook.java	2012-01-25 22:11:28 UTC (rev 2222)
@@ -38,7 +38,6 @@
 import org.crosswire.jsword.passage.Key;
 import org.crosswire.jsword.passage.NoSuchKeyException;
 import org.crosswire.jsword.passage.ReadOnlyKeyList;
-import org.crosswire.jsword.versification.ReferenceSystem;
 import org.jdom.Content;
 
 /**
@@ -162,13 +161,6 @@
     }
 
     /* (non-Javadoc)
-     * @see org.crosswire.jsword.passage.KeyFactory#getGlobalKeyList(org.crosswire.jsword.versification.ReferenceSystem)
-     */
-    public Key getGlobalKeyList(ReferenceSystem ref) {
-        return getGlobalKeyList();
-    }
-
-    /* (non-Javadoc)
      * @see org.crosswire.jsword.passage.KeyFactory#getGlobalKeyList()
      */
     public Key getGlobalKeyList() {
@@ -189,13 +181,6 @@
     }
 
     /* (non-Javadoc)
-     * @see org.crosswire.jsword.passage.KeyFactory#getValidKey(org.crosswire.jsword.versification.ReferenceSystem, java.lang.String)
-     */
-    public Key getValidKey(ReferenceSystem referenceSystem, String name) {
-        return getValidKey(name);
-    }
-
-    /* (non-Javadoc)
      * @see org.crosswire.jsword.passage.KeyFactory#getKey(java.lang.String)
      */
     public Key getKey(String text) throws NoSuchKeyException {
@@ -234,26 +219,12 @@
     }
 
     /* (non-Javadoc)
-     * @see org.crosswire.jsword.passage.KeyFactory#getKey(org.crosswire.jsword.versification.ReferenceSystem, java.lang.String)
-     */
-    public Key getKey(ReferenceSystem referenceSystem, String text) throws NoSuchKeyException {
-        return getKey(text);
-    }
-
-    /* (non-Javadoc)
      * @see org.crosswire.jsword.passage.KeyFactory#createEmptyKeyList()
      */
     public Key createEmptyKeyList() {
         return new DefaultKeyList();
     }
 
-    /* (non-Javadoc)
-     * @see org.crosswire.jsword.passage.KeyFactory#createEmptyKeyList(org.crosswire.jsword.versification.ReferenceSystem)
-     */
-    public Key createEmptyKeyList(ReferenceSystem referenceSystem) {
-        return createEmptyKeyList();
-    }
-
     /**
      * Helper method so we can quickly activate ourselves on access
      */

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/passage/AbstractPassage.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/passage/AbstractPassage.java	2012-01-25 21:32:57 UTC (rev 2221)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/passage/AbstractPassage.java	2012-01-25 22:11:28 UTC (rev 2222)
@@ -612,7 +612,7 @@
         optimizeWrites();
         raiseNormalizeProtection();
 
-        remove(VerseRange.getWholeBibleVerseRange());
+        remove(getVersification().getAllVerses());
 
         if (lowerEventSuppresionAndTest()) {
             fireIntervalRemoved(this, null, null);

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/passage/VerseRange.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/passage/VerseRange.java	2012-01-25 21:32:57 UTC (rev 2221)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/passage/VerseRange.java	2012-01-25 22:11:28 UTC (rev 2222)
@@ -773,36 +773,6 @@
         return null;
     }
 
-    /**
-     * Returns a VerseRange that wraps the whole Bible
-     * 
-     * @return The whole Bible VerseRange
-     */
-    @Deprecated
-    public static VerseRange getWholeBibleVerseRange() {
-        return whole;
-    }
-
-    /**
-     * Returns a VerseRange that wraps the Old Testament
-     * 
-     * @return The Old Testament VerseRange
-     */
-    @Deprecated
-    public static VerseRange getOldTestamentVerseRange() {
-        return otRange;
-    }
-
-    /**
-     * Returns a VerseRange that wraps the New Testament
-     * 
-     * @return The New Testament VerseRange
-     */
-    @Deprecated
-    public static VerseRange getNewTestamentVerseRange() {
-        return ntRange;
-    }
-
     private String doGetName(Key base) throws NoSuchVerseException {
         // Cache these we're going to be using them a lot.
         BibleBook startBook = start.getBook();
@@ -1146,32 +1116,6 @@
     private transient String originalName;
 
     /**
-     * The whole Bible VerseRange
-     */
-    @Deprecated
-    private static transient VerseRange whole;
-
-    /**
-     * The Old Testament VerseRange
-     */
-    @Deprecated
-    private static transient VerseRange otRange;
-
-    /**
-     * The New Testament VerseRange
-     */
-    @Deprecated
-    private static transient VerseRange ntRange;
-
-    static {
-        whole = new VerseRange(new Verse(BibleBook.GEN, 1, 1), new Verse(BibleBook.REV, 22, 21));
-
-        otRange = new VerseRange(new Verse(BibleBook.GEN, 1, 1), new Verse(BibleBook.MAL, 4, 6));
-
-        ntRange = new VerseRange(new Verse(BibleBook.MATT, 1, 1), new Verse(BibleBook.REV, 22, 21));
-    }
-
-    /**
      * The log stream
      */
     /* pkg protected */static final transient Logger log = Logger.getLogger(VerseRange.class);

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/versification/BibleBook.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/versification/BibleBook.java	2012-01-25 21:32:57 UTC (rev 2221)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/versification/BibleBook.java	2012-01-25 22:11:28 UTC (rev 2222)
@@ -27,7 +27,7 @@
 
 /**
  * A BibleBook is a book of the Bible. It may or may not be canonical.
- * Note that the ordering of these books varies from one ReferenceSystem to another. 
+ * Note that the ordering of these books varies from one Versification to another. 
  */
 public enum BibleBook {
     // JSword introduction to the Bible

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/versification/BibleBookList.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/versification/BibleBookList.java	2012-01-25 21:32:57 UTC (rev 2221)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/versification/BibleBookList.java	2012-01-25 22:11:28 UTC (rev 2222)
@@ -27,7 +27,7 @@
 
 /**
  * A BibleBookList is an ordered list of one or more BibleBooks.
- * Typically, a BibleBookList is a member of a ReferenceSystem.
+ * Typically, a BibleBookList is a member of a Versification.
  *
  * @see gnu.lgpl.License for license details.<br>
  *      The copyright to this program is held by it's authors.
@@ -44,7 +44,7 @@
     }
 
     /**
-     * Does this ReferenceSystem contain the BibleBook.
+     * Does this Versification contain the BibleBook.
      * 
      * @param book
      * @return true if it is present.
@@ -67,7 +67,7 @@
     }
 
     /**
-     * Get the number of books in this ReferenceSystem.
+     * Get the number of books in this Versification.
      * @return the number of books
      */
     public int getBookCount() {
@@ -75,7 +75,7 @@
     }
 
     /**
-     * Get the BibleBook by its position in this ReferenceSystem.
+     * Get the BibleBook by its position in this Versification.
      * If the position is negative, return the first book.
      * If the position is greater than the last, return the last book.
      * 
@@ -94,7 +94,7 @@
     }
 
     /**
-     * Get the BibleBooks in this ReferenceSystem.
+     * Get the BibleBooks in this Versification.
      * 
      * @return an Iterator over the books
      */
@@ -147,8 +147,8 @@
     }
 
     /**
-     * Given a BibleBook, get the previous BibleBook in this ReferenceSystem. If it is the first book, return null.
-     * @param book A BibleBook in the ReferenceSystem
+     * Given a BibleBook, get the previous BibleBook in this Versification. If it is the first book, return null.
+     * @param book A BibleBook in the Versification
      * @return the previous BibleBook or null.
      */
     public BibleBook getPreviousBook(BibleBook book) {
@@ -162,8 +162,8 @@
     }
 
     /**
-     * Given a BibleBook, get the next BibleBook in this ReferenceSystem. If it is the last book, return null.
-     * @param book A BibleBook in the ReferenceSystem
+     * Given a BibleBook, get the next BibleBook in this Versification. If it is the last book, return null.
+     * @param book A BibleBook in the Versification
      * @return the previous BibleBook or null.
      */
     public BibleBook getNextBook(BibleBook book) {

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/versification/BibleInfo.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/versification/BibleInfo.java	2012-01-25 21:32:57 UTC (rev 2221)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/versification/BibleInfo.java	2012-01-25 22:11:28 UTC (rev 2222)
@@ -34,7 +34,7 @@
  * of the KJV Bible. It is not true of other versifications such as Luther's.
  * </p>
  *
- * @deprecated Use ReferenceSystems.getReferenceSystem("KJV") instead.
+ * @deprecated Use Versifications.getVersification("KJV") instead.
  * 
  * @see gnu.lgpl.License for license details.<br>
  *      The copyright to this program is held by it's authors.

Deleted: trunk/jsword/src/main/java/org/crosswire/jsword/versification/ReferenceSystem.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/versification/ReferenceSystem.java	2012-01-25 21:32:57 UTC (rev 2221)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/versification/ReferenceSystem.java	2012-01-25 22:11:28 UTC (rev 2222)
@@ -1,33 +0,0 @@
-/**
- * Distribution License:
- * JSword is free software; you can redistribute it and/or modify it under
- * the terms of the GNU Lesser General Public License, version 2.1 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 Lesser General Public License for more details.
- *
- * The License is available on the internet at:
- *       http://www.gnu.org/copyleft/lgpl.html
- * or by writing to:
- *      Free Software Foundation, Inc.
- *      59 Temple Place - Suite 330
- *      Boston, MA 02111-1307, USA
- *
- * Copyright: 2012
- *     The copyright to this program is held by it's authors.
- *
- * ID: $Id: org.eclipse.jdt.ui.prefs 1178 2006-11-06 12:48:02Z dmsmith $
- */
-package org.crosswire.jsword.versification;
-
-/**
- * A ReferenceSystem is a marker interface.
- *
- * @see gnu.lgpl.License for license details.<br>
- *      The copyright to this program is held by it's authors.
- * @author DM Smith [dmsmith555 at yahoo dot com]
- */
-public interface ReferenceSystem {
-
-}

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/versification/Versification.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/versification/Versification.java	2012-01-25 21:32:57 UTC (rev 2221)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/versification/Versification.java	2012-01-25 22:11:28 UTC (rev 2222)
@@ -26,8 +26,10 @@
 
 import org.crosswire.jsword.JSMsg;
 import org.crosswire.jsword.JSOtherMsg;
+import org.crosswire.jsword.book.ReferenceSystem;
 import org.crosswire.jsword.passage.NoSuchVerseException;
 import org.crosswire.jsword.passage.Verse;
+import org.crosswire.jsword.passage.VerseRange;
 
 /**
  * A named Versification defines
@@ -46,7 +48,7 @@
     /**
      * Construct a Versification.
      * 
-     * @param osisName
+     * @param name
      *            The name of this reference system
      * @param booksOT
      *            An ordered list of books in this reference system. The list
@@ -63,8 +65,8 @@
      *            each chapter whose value is the highest numbered verse in that
      *            chapter. Do not include chapter 0.
      */
-    public Versification(String osisName, BibleBook[] booksOT, BibleBook[] booksNT, int[][] lastVerseOT, int[][] lastVerseNT) {
-        this.osisName = osisName;
+    public Versification(String name, BibleBook[] booksOT, BibleBook[] booksNT, int[][] lastVerseOT, int[][] lastVerseNT) {
+        this.name = name;
 
         // Copy the books into an aggregated BibleBook array
         // including INTRO_BIBLE and INTRO_OT/INTRO_NT for non-null book lists
@@ -176,8 +178,8 @@
      * Get the OSIS name for this Versification.
      * @return the OSIS name of the Versification
      */
-    public String getOSISName() {
-        return osisName;
+    public String getName() {
+        return name;
     }
 
     public BibleBookList getBooks() {
@@ -227,6 +229,19 @@
     }
 
     /**
+     * Get a VerseRange encompassing this Versification.
+     */
+    public VerseRange getAllVerses() {
+        BibleBook book = bookList.getFirstBook();
+        int chapter = getLastChapter(book);
+        Verse first = new Verse(book, chapter, getLastVerse(book, chapter));
+        book = bookList.getLastBook();
+        chapter = getLastChapter(book);
+        Verse last = new Verse(book, chapter, getLastVerse(book, chapter));
+        return new VerseRange(this, first, last);
+    }
+
+    /**
      * Create a new Verse being the last verse in the current book
      *
      * @return The last verse in this book
@@ -728,7 +743,7 @@
     }
 
     /** The OSIS name of the reference system. */
-    private String osisName;
+    private String name;
 
 
     private BibleBookList bookList;

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/versification/system/SystemCatholic.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/versification/system/SystemCatholic.java	2012-01-25 21:32:57 UTC (rev 2221)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/versification/system/SystemCatholic.java	2012-01-25 22:11:28 UTC (rev 2222)
@@ -34,7 +34,7 @@
 public class SystemCatholic extends Versification {
 
     /**
-     * Build the "Catholic" ReferenceSystem.
+     * Build the "Catholic" Versification.
      */
     public SystemCatholic() {
         super(name, booksOT, booksNT, lastVerseOT, lastVerseNT);

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/versification/system/SystemCatholic2.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/versification/system/SystemCatholic2.java	2012-01-25 21:32:57 UTC (rev 2221)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/versification/system/SystemCatholic2.java	2012-01-25 22:11:28 UTC (rev 2222)
@@ -35,7 +35,7 @@
  */
 public class SystemCatholic2 extends Versification {
     /**
-     * Build the "Catholic2" ReferenceSystem.
+     * Build the "Catholic2" Versification.
      */
     public SystemCatholic2() {
         super(name, booksOT, booksNT, lastVerseOT, lastVerseNT);

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/versification/system/SystemGerman.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/versification/system/SystemGerman.java	2012-01-25 21:32:57 UTC (rev 2221)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/versification/system/SystemGerman.java	2012-01-25 22:11:28 UTC (rev 2222)
@@ -33,7 +33,7 @@
  */
 public class SystemGerman extends Versification {
     /**
-     * Build the "German" ReferenceSystem.
+     * Build the "German" Versification.
      */
     public SystemGerman() {
         super(name, booksOT, booksNT, lastVerseOT, lastVerseNT);

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/versification/system/SystemKJV.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/versification/system/SystemKJV.java	2012-01-25 21:32:57 UTC (rev 2221)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/versification/system/SystemKJV.java	2012-01-25 22:11:28 UTC (rev 2222)
@@ -34,7 +34,7 @@
  */
 public class SystemKJV extends Versification {
     /**
-     * Build the "KJV" ReferenceSystem.
+     * Build the "KJV" Versification.
      */
     public SystemKJV() {
         super(name, booksOT, booksNT, lastVerseOT, lastVerseNT);

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/versification/system/SystemKJVA.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/versification/system/SystemKJVA.java	2012-01-25 21:32:57 UTC (rev 2221)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/versification/system/SystemKJVA.java	2012-01-25 22:11:28 UTC (rev 2222)
@@ -33,7 +33,7 @@
  */
 public class SystemKJVA extends Versification {
     /**
-     * Build the "KJVA" ReferenceSystem.
+     * Build the "KJVA" Versification.
      */
     public SystemKJVA() {
         super(name, booksOT, booksNT, lastVerseOT, lastVerseNT);

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/versification/system/SystemLeningrad.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/versification/system/SystemLeningrad.java	2012-01-25 21:32:57 UTC (rev 2221)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/versification/system/SystemLeningrad.java	2012-01-25 22:11:28 UTC (rev 2222)
@@ -37,7 +37,7 @@
  */
 public class SystemLeningrad extends Versification {
     /**
-     * Build the "Leningrad" ReferenceSystem.
+     * Build the "Leningrad" Versification.
      */
     public SystemLeningrad() {
         super(name, booksOT, booksNT, lastVerseOT, null);

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/versification/system/SystemLuther.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/versification/system/SystemLuther.java	2012-01-25 21:32:57 UTC (rev 2221)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/versification/system/SystemLuther.java	2012-01-25 22:11:28 UTC (rev 2222)
@@ -33,7 +33,7 @@
  */
 public class SystemLuther extends Versification {
     /**
-     * Build the "Luther" ReferenceSystem.
+     * Build the "Luther" Versification.
      */
     public SystemLuther() {
         super(name, booksOT, booksNT, lastVerseOT, lastVerseNT);

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/versification/system/SystemMT.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/versification/system/SystemMT.java	2012-01-25 21:32:57 UTC (rev 2221)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/versification/system/SystemMT.java	2012-01-25 22:11:28 UTC (rev 2222)
@@ -37,7 +37,7 @@
  */
 public class SystemMT extends Versification {
     /**
-     * Build the "MT" ReferenceSystem.
+     * Build the "MT" Versification.
      */
     public SystemMT() {
         super(name, booksOT, booksNT, lastVerseOT, null);

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/versification/system/SystemNRSV.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/versification/system/SystemNRSV.java	2012-01-25 21:32:57 UTC (rev 2221)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/versification/system/SystemNRSV.java	2012-01-25 22:11:28 UTC (rev 2222)
@@ -35,7 +35,7 @@
  */
 public class SystemNRSV extends Versification {
     /**
-     * Build the "NRSV" ReferenceSystem.
+     * Build the "NRSV" Versification.
      */
     public SystemNRSV() {
         super(name, booksOT, booksNT, lastVerseOT, lastVerseNT);

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/versification/system/SystemNRSVA.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/versification/system/SystemNRSVA.java	2012-01-25 21:32:57 UTC (rev 2221)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/versification/system/SystemNRSVA.java	2012-01-25 22:11:28 UTC (rev 2222)
@@ -38,7 +38,7 @@
     private static final long serialVersionUID = -1915001343269114316L;
 
     /**
-     * Build the "NRSVA" ReferenceSystem.
+     * Build the "NRSVA" Versification.
      */
     public SystemNRSVA() {
         super(name, booksOT, booksNT, lastVerseOT, lastVerseNT);

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/versification/system/SystemSynodal.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/versification/system/SystemSynodal.java	2012-01-25 21:32:57 UTC (rev 2221)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/versification/system/SystemSynodal.java	2012-01-25 22:11:28 UTC (rev 2222)
@@ -62,7 +62,7 @@
      */
     private static final long serialVersionUID = -6281906491023123413L;
     /**
-     * Build the "Synodal" ReferenceSystem.
+     * Build the "Synodal" Versification.
      */
     public SystemSynodal() {
         super(name, booksOT, booksNT, lastVerseOT, lastVerseNT);

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/versification/system/SystemSynodalP.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/versification/system/SystemSynodalP.java	2012-01-25 21:32:57 UTC (rev 2221)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/versification/system/SystemSynodalP.java	2012-01-25 22:11:28 UTC (rev 2222)
@@ -36,7 +36,7 @@
  */
 public class SystemSynodalP extends Versification {
     /**
-     * Build the "SynodalP" ReferenceSystem.
+     * Build the "SynodalP" Versification.
      */
     public SystemSynodalP() {
         super(name, booksOT, booksNT, lastVerseOT, lastVerseNT);

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/versification/system/SystemVulg.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/versification/system/SystemVulg.java	2012-01-25 21:32:57 UTC (rev 2221)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/versification/system/SystemVulg.java	2012-01-25 22:11:28 UTC (rev 2222)
@@ -33,7 +33,7 @@
  */
 public class SystemVulg extends Versification {
     /**
-     * Build the "Vulg" ReferenceSystem.
+     * Build the "Vulg" Versification.
      */
     public SystemVulg() {
         super(name, booksOT, booksNT, lastVerseOT, lastVerseNT);

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/versification/system/Versifications.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/versification/system/Versifications.java	2012-01-25 21:32:57 UTC (rev 2221)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/versification/system/Versifications.java	2012-01-25 22:11:28 UTC (rev 2222)
@@ -29,8 +29,8 @@
 import org.crosswire.jsword.versification.Versification;
 
 /**
- * The ReferenceSystems class manages the creation of ReferenceSystems as needed.
- * It delays the construction of the ReferenceSystem until getReferenceSystem(String name) is called.
+ * The Versifications class manages the creation of Versifications as needed.
+ * It delays the construction of the Versification until getVersification(String name) is called.
  *
  * @see gnu.lgpl.License for license details.<br>
  *      The copyright to this program is held by it's authors.
@@ -39,7 +39,7 @@
 public class Versifications {
 
     /**
-     * Get the singleton instance of ReferenceSystems.
+     * Get the singleton instance of Versifications.
      * 
      * @return the singleton
      */
@@ -48,10 +48,10 @@
     }
 
     /**
-     * Get the ReferenceSystem by its name. If name is null then return the default ReferenceSystem.
+     * Get the Versification by its name. If name is null then return the default Versification.
      * 
-     * @param name the name of the ReferenceSystem
-     * @return the ReferenceSystem or null if it is not known.
+     * @param name the name of the Versification
+     * @return the Versification or null if it is not known.
      */
     public synchronized Versification getVersification(String name) {
         String actual = name;
@@ -59,7 +59,7 @@
             actual = DEFAULT_REFERENCE_SYSTEM;
         }
 
-        // This class delays the building of a ReferenceSystem to when it is
+        // This class delays the building of a Versification to when it is
         // actually needed.
         Versification rs = fluffed.get(actual);
         if (rs == null) {
@@ -73,10 +73,10 @@
     }
 
     /**
-     * Determine whether the named ReferenceSystem is known.
+     * Determine whether the named Versification is known.
      * 
-     * @param name the name of the ReferenceSystem
-     * @return true when the ReferenceSystem is available for use
+     * @param name the name of the Versification
+     * @return true when the Versification is available for use
      */
     public synchronized boolean isDefined(String name) {
         return name == null || known.contains(name);
@@ -123,13 +123,13 @@
     }
 
     /**
-     * Add a ReferenceSystem that is not predefined by JSword.
+     * Add a Versification that is not predefined by JSword.
      * 
-     * @param rs the ReferenceSystem to register
+     * @param rs the Versification to register
      */
     public synchronized void register(Versification rs) {
-        fluffed.put(rs.getOSISName(), rs);
-        known.add(rs.getOSISName());
+        fluffed.put(rs.getName(), rs);
+        known.add(rs.getName());
     }
 
     /**
@@ -154,7 +154,7 @@
     }
 
     /**
-     * The default ReferenceSystem for JSword is the KJV.
+     * The default Versification for JSword is the KJV.
      * This is subject to change at any time.
      */
     private final String DEFAULT_REFERENCE_SYSTEM = "KJV";
@@ -165,7 +165,7 @@
     private Set<String> known;
 
     /**
-     * The map of instantiated ReferenceSystems, given by their names.
+     * The map of instantiated Versifications, given by their names.
      */
     private Map<String, Versification> fluffed;
 




More information about the jsword-svn mailing list