Package javax.jdo
Interface Extent<E>
-
- All Superinterfaces:
AutoCloseable,Iterable<E>
public interface Extent<E> extends AutoCloseable, Iterable<E>
Instances of theExtentclass represent the entire collection of instances in the data store of the candidate class or interface possibly including its subclasses or subinterfaces.The
Extentinstance has two possible uses:- to iterate all instances of a particular class or interface
- to execute a
Queryin the data store over all instances of a particular class or interface
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclose()Don't use this method directly; usecloseAll()instead.voidclose(Iterator<E> it)Close anIteratorassociated with thisExtentinstance.voidcloseAll()Close allIterators associated with thisExtentinstance.Class<E>getCandidateClass()AnExtentcontains all instances of a particular class or interface in the data store; this method returns theClassof the instances represented by this Extent.FetchPlangetFetchPlan()Get the fetch plan associated with this Extent.PersistenceManagergetPersistenceManager()AnExtentis managed by aPersistenceManager; this method gives access to the owningPersistenceManager.booleanhasSubclasses()Returns whether thisExtentwas defined to contain subclasses.Iterator<E>iterator()Returns an iterator over all the instances in theExtent.-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Method Detail
-
iterator
Iterator<E> iterator()
Returns an iterator over all the instances in theExtent. The behaviour of the returned iterator might depend on the setting of theignoreCacheflag in the owningPersistenceManager.
-
hasSubclasses
boolean hasSubclasses()
Returns whether thisExtentwas defined to contain subclasses.- Returns:
- true if this
Extentwas defined to contain instances that are of a subclass type.
-
getCandidateClass
Class<E> getCandidateClass()
AnExtentcontains all instances of a particular class or interface in the data store; this method returns theClassof the instances represented by this Extent.- Returns:
- the
Classof instances of thisExtent.
-
getPersistenceManager
PersistenceManager getPersistenceManager()
AnExtentis managed by aPersistenceManager; this method gives access to the owningPersistenceManager.- Returns:
- the owning
PersistenceManager
-
closeAll
void closeAll()
Close allIterators associated with thisExtentinstance.Iterators closed by this method will returnfalsetohasNext()and will throwNoSuchElementExceptiononnext(). TheExtentinstance can still be used as a parameter ofQuery.setExtent, and to get anIterator.
-
close
void close(Iterator<E> it)
Close anIteratorassociated with thisExtentinstance.Iterators closed by this method will returnfalsetohasNext()and will throwNoSuchElementExceptiononnext(). TheExtentinstance can still be used as a parameter ofQuery.setExtent, and to get anIterator.- Parameters:
it- anIteratorobtained by the methoditerator()on thisExtentinstance.
-
close
void close() throws ExceptionDon't use this method directly; usecloseAll()instead. It is intended for use with try-with-resources.- Specified by:
closein interfaceAutoCloseable- Throws:
Exception- if this resource cannot be closed
-
getFetchPlan
FetchPlan getFetchPlan()
Get the fetch plan associated with this Extent.- Returns:
- the fetch plan
- Since:
- 2.0
-
-