[jsword-svn] r1806 - trunk/jsword/src/main/java/org/crosswire/jsword/bridge
dmsmith at www.crosswire.org
dmsmith at www.crosswire.org
Sun Apr 20 12:59:01 MST 2008
Author: dmsmith
Date: 2008-04-20 12:59:00 -0700 (Sun, 20 Apr 2008)
New Revision: 1806
Modified:
trunk/jsword/src/main/java/org/crosswire/jsword/bridge/DwrBridge.java
Log:
Added to DwrBridge the ability to determine the size of a reference.
Modified: trunk/jsword/src/main/java/org/crosswire/jsword/bridge/DwrBridge.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/bridge/DwrBridge.java 2008-04-20 19:42:31 UTC (rev 1805)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/bridge/DwrBridge.java 2008-04-20 19:59:00 UTC (rev 1806)
@@ -100,6 +100,25 @@
}
/**
+ * Determine the size of this reference.
+ *
+ * @param bookInitials the book to which the reference applies.
+ * @param reference the actual reference
+ * @return the number of entries for this reference.
+ * @throws NoSuchKeyException
+ */
+ public int getCardinality(String bookInitials, String reference) throws NoSuchKeyException
+ {
+ Book book = BookInstaller.getInstalledBook(bookInitials);
+ if (book != null)
+ {
+ Key key = book.getKey(reference);
+ return key.getCardinality();
+ }
+ return 0;
+ }
+
+ /**
* Obtain the OSIS representation from a book for a reference, pruning a reference to a limited number of keys.
*
* @param bookInitials the book to use
More information about the jsword-svn
mailing list