!--a11y-->
Extent 
An instance of the javax.jdo.Extent interface represents a set of all persistent instances of a candidate class, optionally including the subclasses as well.
Extents are generally used to specify the set of instances of the candidate class that are to be filtered by the query. They can be also used to iterate over the included instances of the candidate class.
The extent differs from a collection in that it can identify the instances in the datastore, which enables the objects to be instantiated in the memory only after they have been accessed by an iterator.
To create an extent, use the getExtent(Class persistenceCapableClass, boolean subclasses) method of the PersistenceManager interface:

Extent employeeExtent = pm.getExtent(Employee, true); |
The example creates an extent for the Employee class including all subclasses.
You can iterate over the elements of an extent using an iterator, which is obtained by invoking the Extent.iterator() method:

Iterator iter = employeeExtent.iterator(); while(iter.hasNext()) { Employee emp = (Employee)iter.next(); doSomething(emp.getFirstName()+" "+emp.getLastName()); } |
The example creates an iterator from the employeeExtent, iterates over all elements, and calls the doSomething() method for each employee.
