public interface Extent<E> extends Iterable<E>, AutoCloseable
Extent
class represent the entire collection
of instances in the data store of the candidate class or interface
possibly including its subclasses or subinterfaces.
The Extent
instance has two possible uses:
Query
in the data store over all instances
of a particular class or interface
Modifier and Type | Method and Description |
---|---|
void |
close()
Don't use this method directly; use
closeAll() instead. |
void |
close(Iterator<E> it)
Close an
Iterator associated with this Extent instance. |
void |
closeAll()
Close all
Iterator s associated with this Extent instance. |
Class<E> |
getCandidateClass()
An
Extent contains all instances of a particular class
or interface in the data
store; this method returns the Class of the instances
represented by this Extent. |
FetchPlan |
getFetchPlan()
Get the fetch plan associated with this Extent.
|
PersistenceManager |
getPersistenceManager()
An
Extent is managed by a PersistenceManager ;
this method gives access to the owning PersistenceManager . |
boolean |
hasSubclasses()
Returns whether this
Extent was defined to contain subclasses. |
Iterator<E> |
iterator()
Returns an iterator over all the instances in the
Extent . |
forEach, spliterator
Iterator<E> iterator()
Extent
.
The behavior of the returned iterator might depend on the setting of the
ignoreCache
flag in the owning PersistenceManager
.boolean hasSubclasses()
Extent
was defined to contain subclasses.Extent
was defined to contain instances
that are of a subclass type.Class<E> getCandidateClass()
Extent
contains all instances of a particular class
or interface in the data
store; this method returns the Class
of the instances
represented by this Extent.Class
of instances of this Extent
.PersistenceManager getPersistenceManager()
Extent
is managed by a PersistenceManager
;
this method gives access to the owning PersistenceManager
.PersistenceManager
void closeAll()
Iterator
s associated with this Extent
instance.
Iterator
s closed by this method will return false
to hasNext()
and will throw
NoSuchElementException
on next()
.
The Extent
instance can still be used
as a parameter of Query.setExtent
, and to get an Iterator
.void close(Iterator<E> it)
Iterator
associated with this Extent
instance.
Iterator
s closed by this method will return false
to hasNext()
and will throw NoSuchElementException
on next()
. The Extent
instance can still be used
as a parameter of Query.setExtent
, and to get an Iterator
.it
- an Iterator
obtained by the method
iterator()
on this Extent
instance.void close() throws Exception
closeAll()
instead. It is intended for use with try-with-resources.close
in interface AutoCloseable
Exception
- if this resource cannot be closedFetchPlan getFetchPlan()
Copyright © 2005–1970 Apache Software Foundation. All rights reserved.