[jsword-svn] common/java/core/org/crosswire/common/util s
jswordcvs at crosswire.org
jswordcvs at crosswire.org
Tue Mar 22 19:05:35 MST 2005
Update of /cvs/jsword/common/java/core/org/crosswire/common/util
In directory www.crosswire.org:/tmp/cvs-serv26562/java/core/org/crosswire/common/util
Modified Files:
CollectionUtil.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: CollectionUtil.java
===================================================================
RCS file: /cvs/jsword/common/java/core/org/crosswire/common/util/CollectionUtil.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** CollectionUtil.java 20 Apr 2004 21:16:06 -0000 1.1
--- CollectionUtil.java 23 Mar 2005 02:05:33 -0000 1.2
***************
*** 2,7 ****
--- 2,9 ----
import java.util.ArrayList;
+ import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
+ import java.util.Set;
/**
***************
*** 39,43 ****
/**
! * Create a List (actually an ArrayList) from an Iterator.
* @param it The source of data for the list
* @return List
--- 41,45 ----
/**
! * Create a List from an Iterator.
* @param it The source of data for the list
* @return List
***************
*** 53,55 ****
--- 55,72 ----
return reply;
}
+ /**
+ * Create a Set from an Iterator.
+ * @param it The source of data for the list
+ * @return the created set
+ */
+ public static Set createSet(Iterator it)
+ {
+ Set reply = new HashSet();
+ while (it.hasNext())
+ {
+ reply.add(it.next());
+ }
+
+ return reply;
+ }
}
More information about the jsword-svn
mailing list