SolarMetric Kodo JDO 2.4.3 generated on March 27 2003

com.solarmetric.kodo.runtime.objectprovider
Interface ResultList

All Superinterfaces:
Collection, List, Serializable
All Known Implementing Classes:
EagerResultList, LazyResultList

public interface ResultList
extends List, Serializable

List interface that represents a potentially lazy ResultList instantiation. In accordance with section 14.6.7 of the JDO specification, iterators obtained from a Query or Extent that have been subsequently closed will return false for hasNext()

A ResultList will typically be instantiated from a factory, and will use a ResultObjectProvider for obtaining individual object data representations. For exmaple:

	java.sql.ResultSet rs = myStatement.executeQuery ("SELECT NAME FROM FOO");
	ResultList names = ResultListFactory.createResultList (threshold, rs,
		new ResultObjectProvider ()
		{
			public Object getResultObject (Object currentRow)
				throws Exception
			{
				return ((ResultSet) currentRow).getString ("NAME");
			}

			public void open (Object input) 
			{ 
				((ResultSet) input).next ();
			}

			public void advance (Object input) { }
			{ 
				((ResultSet) input).next ();
			}

			public void free () { }
		});
	

Depending on the data store support for scrolling result sets, the list that is returned may use lazy instantiation of the objects, and thus allow very large result sets to be obtained and manipulated.

Note that wrapping a ResultList in another Collection will always instantiate the entire set of elements contained in the ResultList. This may not always be desireable, since the list may be very large.

Since:
2.2.6

Method Summary
 void checkClosed()
          Check to see if this ResultList has been closed, and if so, throw a JDOUserException.
 void close()
          Close the list.
 int getInstantiatedCount()
          Returns the number of objects that are currently instantiated internally in this list.
 boolean isClosed()
          Returns true if the list has been closed.
 
Methods inherited from interface java.util.List
add, add, addAll, addAll, clear, contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, retainAll, set, size, subList, toArray, toArray
 

Method Detail

close

public void close()
           throws JDOException
Close the list.

isClosed

public boolean isClosed()
                 throws JDOException
Returns true if the list has been closed.

checkClosed

public void checkClosed()
                 throws JDOException
Check to see if this ResultList has been closed, and if so, throw a JDOUserException.

getInstantiatedCount

public int getInstantiatedCount()
Returns the number of objects that are currently instantiated internally in this list.

SolarMetric Kodo JDO 2.4.3 generated on March 27 2003

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