Overview | Package | Class | Tree | Deprecated | Index | Help
| SolarMetric Kodo JDO 2.5.8 generated on January 11 2004
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.solarmetric.kodo.runtime.objectprovider
Interface ResultList

All Superinterfaces:
  Collection, List, Serializable

All Known Subinterfaces:
  CachingList, CustomResultList

All Known Implementing Classes:
  CacheAwareQuery.CachedResultList, CollectionResultList, MergedResultList

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 boolean open (Object input)
    			{
    				return ((ResultSet) input).next ();
    			}

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

    			public void free (Object input) { }
    		});

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.

Overview | Package | Class | Tree | Deprecated | Index | Help
| SolarMetric Kodo JDO 2.5.8 generated on January 11 2004
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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