Overview | Package | Class | Tree | Deprecated | Index | Help
| SolarMetric Kodo JDO 2.5.0 Reverse Schema Tool
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.solarmetric.rd.rop
Interface ResultList

All Superinterfaces:
  java.util.Collection, java.util.List, java.io.Serializable

All Known Implementing Classes:
  CollectionResultList, EagerResultList, LazyResultList, MergedResultList

public interface ResultList
extends java.util.List, java.io.Serializable

List interface that represents a potentially lazy ResultList instantiation.

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

``

    	java.sql.ResultSet rs = myStatement.executeQuery ("SELECT NAME FROM FOO");
    	ResultList names = factory.createResultList (rs,
    		new ResultObjectProvider ()
    		{
    			public boolean supportsRandomAccess (Object input)
    			{
    				return false;
    			}

    			public void setFetchBatchSize (Object input, int fetchBatchSize)
    			{
    			}

    			public Object getResultObject (Object input)
    			{
    				return ((ResultSet) input).getString ("NAME");
    			}

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

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

    			public boolean absolute (Object input, int pos)
    			{
    				throw new UnsupportedOptionException ();
    			}

    			public int size (Object input)
    			{
    				return Integer.MAX_VALUE;
    			}

    			public void free (Object input)
    			{
    				((ResultSet) input).close ();
    			}
    		});

Depending on the support for scrolling inputs, 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 `NoSuchElementException`.
`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()

  Close the list.

### isClosed

    public boolean isClosed()

  Returns true if the list has been closed.

### checkClosed

    public void checkClosed()

  Check to see if this ResultList has been closed, and if so, throw a `NoSuchElementException`.

### 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.0 Reverse Schema Tool
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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