[jsword-svn] jsword/java/jsword/org/crosswire/jsword/book/readings s

jswordcvs at crosswire.org jswordcvs at crosswire.org
Tue Mar 22 19:05:40 MST 2005


Update of /cvs/jsword/jsword/java/jsword/org/crosswire/jsword/book/readings
In directory www.crosswire.org:/tmp/cvs-serv26577/java/jsword/org/crosswire/jsword/book/readings

Modified Files:
	ReadingsBookDriver.java 
Log Message:
Made BookDriver a singleton with an instance() method which is used by reflection in Books to get an instance of a particular BookDriver.
Made registerDriver also re-register the driver.

Index: ReadingsBookDriver.java
===================================================================
RCS file: /cvs/jsword/jsword/java/jsword/org/crosswire/jsword/book/readings/ReadingsBookDriver.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** ReadingsBookDriver.java	19 Mar 2005 01:56:47 -0000	1.13
--- ReadingsBookDriver.java	23 Mar 2005 02:05:38 -0000	1.14
***************
*** 8,11 ****
--- 8,12 ----
  import org.crosswire.common.util.URLFilter;
  import org.crosswire.jsword.book.Book;
+ import org.crosswire.jsword.book.BookDriver;
  import org.crosswire.jsword.book.BookType;
  import org.crosswire.jsword.book.basic.AbstractBookDriver;
***************
*** 65,71 ****
  
      /**
!      * The meta data array
       */
!     private Book[] books;
  
      /**
--- 66,76 ----
  
      /**
!      * Get the singleton instance of this driver.
!      * @return this driver instance
       */
!     public static BookDriver instance()
!     {
!         return INSTANCE;
!     }
  
      /**
***************
*** 117,120 ****
--- 122,130 ----
  
      /**
+      * The meta data array
+      */
+     private Book[] books;
+ 
+     /**
       * Resources subdir for readings sets
       */
***************
*** 122,125 ****
--- 132,140 ----
  
      /**
+      * A shared instance of this driver.
+      */
+     private static final BookDriver INSTANCE = new ReadingsBookDriver();
+ 
+     /**
       * The current readings set
       */



More information about the jsword-svn mailing list