db-jdo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c..@apache.org
Subject svn commit: r585603 - in /db/jdo/trunk/api2/src/java/javax/jdo: Extent.java PersistenceManager.java
Date Wed, 17 Oct 2007 17:50:13 GMT
Author: clr
Date: Wed Oct 17 10:50:12 2007
New Revision: 585603

URL: http://svn.apache.org/viewvc?rev=585603&view=rev
Log:
JDO-542 Update getExtent and Extent interface for Java 5, making Extent<E> an iterable<E>

Modified:
    db/jdo/trunk/api2/src/java/javax/jdo/Extent.java
    db/jdo/trunk/api2/src/java/javax/jdo/PersistenceManager.java

Modified: db/jdo/trunk/api2/src/java/javax/jdo/Extent.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/api2/src/java/javax/jdo/Extent.java?rev=585603&r1=585602&r2=585603&view=diff
==============================================================================
--- db/jdo/trunk/api2/src/java/javax/jdo/Extent.java (original)
+++ db/jdo/trunk/api2/src/java/javax/jdo/Extent.java Wed Oct 17 10:50:12 2007
@@ -22,27 +22,28 @@
 
 package javax.jdo;
 
+import java.lang.Iterable;
 import java.util.Iterator;
 
 /** Instances of the <code>Extent</code> class represent the entire collection
- * of instances in the data store of the candidate class
- * possibly including its subclasses.
+ * of instances in the data store of the candidate class or interface
+ * possibly including its subclasses or subinterfaces.
  * <P>The <code>Extent</code> instance has two possible uses:
  * <ol>
- * <li>to iterate all instances of a particular class 
+ * <li>to iterate all instances of a particular class or interface
  * <li>to execute a <code>Query</code> in the data store over all instances
- * of a particular class
+ * of a particular class or interface
  * </ol>
- * @version 2.0
+ * @version 2.1
  */
-public interface Extent {
+public interface Extent<E> extends Iterable<E> {
         
     /** Returns an iterator over all the instances in the <code>Extent</code>.
      * The behavior of the returned iterator might depend on the setting of the
      * <code>ignoreCache</code> flag in the owning <code>PersistenceManager</code>.
      * @return an iterator over all instances in the <code>Extent</code>
      */
-    Iterator iterator();
+    Iterator<E> iterator();
 
     /** Returns whether this <code>Extent</code> was defined to contain subclasses.
      * @return true if this <code>Extent</code> was defined to contain instances
@@ -50,11 +51,13 @@
      */    
     boolean hasSubclasses();
 
-    /** An <code>Extent</code> contains all instances of a particular class in
the data
-     * store; this method returns the <code>Class</code> of the instances.
+    /** An <code>Extent</code> contains all instances of a particular class 
+     * or interface in the data
+     * store; this method returns the <code>Class</code> of the instances
+     * represented by this Extent.
       * @return the <code>Class</code> of instances of this <code>Extent</code>.
       */
-    Class getCandidateClass();
+    Class<E> getCandidateClass();
 
     /** An <code>Extent</code> is managed by a <code>PersistenceManager</code>;
      * this method gives access to the owning <code>PersistenceManager</code>.
@@ -79,7 +82,7 @@
      * @param it an <code>Iterator</code> obtained by the method
      * <code>iterator()</code> on this <code>Extent</code> instance.
      */    
-    void close (Iterator it);
+    void close (Iterator<E> it);
     
     /** Get the fetch plan associated with this Extent.
      * @return the fetch plan

Modified: db/jdo/trunk/api2/src/java/javax/jdo/PersistenceManager.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/api2/src/java/javax/jdo/PersistenceManager.java?rev=585603&r1=585602&r2=585603&view=diff
==============================================================================
--- db/jdo/trunk/api2/src/java/javax/jdo/PersistenceManager.java (original)
+++ db/jdo/trunk/api2/src/java/javax/jdo/PersistenceManager.java Wed Oct 17 10:50:12 2007
@@ -262,7 +262,7 @@
      * @return an <code>Extent</code> of the specified <code>Class</code>
      * @see Query
      */
-    Extent getExtent (Class persistenceCapableClass, boolean subclasses);
+    <T> Extent<T> getExtent (Class<T> persistenceCapableClass, boolean
subclasses);
 
     /**
      * Equivalent to <code>getExtent (persistenceCapableClass,
@@ -270,7 +270,7 @@
      * @see #getExtent(Class,boolean)
      * @since 2.0
      */
-    Extent getExtent (Class persistenceCapableClass);
+    <T> Extent<T> getExtent (Class<T> persistenceCapableClass);
 
     /** This method locates a persistent instance in the cache of instances
      * managed by this <code>PersistenceManager</code>.



Mime
View raw message