SolarMetric Kodo JDO 2.4.3 generated on March 27 2003

com.solarmetric.kodo.runtime
Class ExtentImpl

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

public abstract class ExtentImpl
extends Object
implements Extent

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()
           
protected abstract  Iterator getIterator()
          Return an iterator over this extent.
 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.

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

getIterator

protected abstract Iterator getIterator()
Return an iterator over this extent.

closeIterator

protected void closeIterator(Iterator iter)
Close the given iterator. Does nothing by default.

SolarMetric Kodo JDO 2.4.3 generated on March 27 2003

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