SolarMetric Kodo JDO 2.5.8 generated on January 11 2004

com.solarmetric.kodo.runtime
Class ExtentImpl

java.lang.Object
  |
  +--com.solarmetric.kodo.runtime.ExtentImpl
All Implemented Interfaces:
Extent, KodoExtent
Direct Known Subclasses:
JDBCExtent

public abstract class ExtentImpl
extends Object
implements KodoExtent

Abstract Extent implementation that takes care of everything but creating and closing iterators.


Constructor Summary
ExtentImpl(PersistenceManager pm, Class type, boolean subs)
          Constructor.
 
Method Summary
 void close(Iterator iter)
           
 void closeAll()
           
protected  void closeIterator(Iterator iter)
          Close the given iterator.
 Class getCandidateClass()
           
 Class[] getImplementingClasses()
          Returns an array of top-level implementing classes.
 Class[] getImplementingClasses(boolean withMetadata)
          Returns an array of top-level implementing classes.
static Class[] getImplementingClasses(Class forClass, boolean includeSubclasses, boolean withMetadata)
          Returns an array of top-level implementing classes for the specified candidate class.
protected  Iterator getIterator()
           
protected abstract  Iterator getIterator(Class candidateClass)
          Return an iterator over the extent for the specified candidate class.
 PersistenceManager getPersistenceManager()
           
 boolean hasSubclasses()
           
static boolean includesClass(Extent extent, Class cls)
          API extension.
 Iterator iterator()
           
 List list()
          API extension.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExtentImpl

public ExtentImpl(PersistenceManager pm,
                  Class type,
                  boolean subs)
Constructor.
Parameters:
pm - the owning persistence manager
type - the candidate class
subs - whether subclasses are included in the extent
Method Detail

list

public List list()
API extension. Returns a list of all objects represented by this extent.
This method creates a List by traversing the entire iterator returned by a call to iterator(). This means that Collection.size() will work correctly, but if the extent represents a large data set, this method may be quite slow and may consume quite a bit of memory.
Specified by:
list in interface KodoExtent

includesClass

public static boolean includesClass(Extent extent,
                                    Class cls)
API extension.

Returns true if instances of cls could be in extent, taking the return value of hasSubclasses() into consideration.

This is static so that it can be invoked on any extent, not just ExtentImpl objects.


iterator

public Iterator iterator()
Specified by:
iterator in interface Extent

getPersistenceManager

public PersistenceManager getPersistenceManager()
Specified by:
getPersistenceManager in interface Extent

getCandidateClass

public Class getCandidateClass()
Specified by:
getCandidateClass in interface Extent

hasSubclasses

public boolean hasSubclasses()
Specified by:
hasSubclasses in interface Extent

closeAll

public void closeAll()
Specified by:
closeAll in interface Extent

close

public void close(Iterator iter)
Specified by:
close in interface Extent

getImplementingClasses

public Class[] getImplementingClasses()
Returns an array of top-level implementing classes. If this Extent's candidate class is a concrete class, then the array will contain only that class. If it is an interface, then an array of all the top-level implementors that have been registered by the JDOImplHelper will be returned.
Specified by:
getImplementingClasses in interface KodoExtent
Since:
2.5

getImplementingClasses

public Class[] getImplementingClasses(boolean withMetadata)
Returns an array of top-level implementing classes. If this Extent's candidate class is a concrete class, then the array will contain only that class. If it is an interface, then an array of all the top-level implementors that have been registered by the JDOImplHelper will be returned.
Specified by:
getImplementingClasses in interface KodoExtent
Parameters:
withMetadata - if true, exclude those implementors that do no have metadata.
Since:
2.5

getImplementingClasses

public static Class[] getImplementingClasses(Class forClass,
                                             boolean includeSubclasses,
                                             boolean withMetadata)
Returns an array of top-level implementing classes for the specified candidate class. If the specified candidate class is a concrete class, then the array will contain only that class. If it is an interface, then an array of all the top-level implementors that have been registered by the JDOImplHelper will be returned.
Since:
2.5

getIterator

protected Iterator getIterator()

getIterator

protected abstract Iterator getIterator(Class candidateClass)
Return an iterator over the extent for the specified candidate class. The candidate class is guaranteed to always be a concrete top-level class.
Parameters:
candidateClass - the class against which the Iterator needs to be obtained. It is important that this parameter be used as opposed to the getCandidateClass() method, since the parameter is always guaranteed to be a concrete class, whereas getCandidateClass() may return an interface.

closeIterator

protected void closeIterator(Iterator iter)
Close the given iterator. Does nothing by default.
Parameters:
iter - the Iterator to close. This can be an instance of the implementation-dependent Iterator, or it may be a MultiIterator.

SolarMetric Kodo JDO 2.5.8 generated on January 11 2004

Copyright 2001,2002,2003 SolarMetric, Inc. All Rights Reserved.