Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.objectstyle.cayenne.util
Class ListResponse

    java.lang.Object
      org.objectstyle.cayenne.util.ListResponse

All Implemented Interfaces:
  java.io.Serializable, QueryResponse

Direct Known Subclasses:
  IncrementalListResponse

    public class ListResponse

extends java.lang.Object
implements QueryResponse, java.io.Serializable

A QueryResponse optimized to hold a single object or data row list.

Since:
  1.2
Author:
  Andrus Adamchik
See Also:
  Serialized Form

Field Summary
`protected int` | `currentIndex`
`protected java.util.List` | `objectList`

Constructor Summary
`ListResponse()` Creates an empty response.
`ListResponse(java.util.List objectList)`
`ListResponse(java.lang.Object object)`

Method Summary
`java.util.List` | `currentList()` Returns a List under the current iterator position.
`int[]` | `currentUpdateCount()` Returns an update count under the current iterator position.
`java.util.List` | `firstList()` A utility method for quickly retrieving the first list in the response.
`int[]` | `firstUpdateCount()` A utility method for quickly retrieving the first update count from the response.
`boolean` | `isList()` Returns whether current iteration result is a list or an update count.
`boolean` | `next()` Rewinds response iterator to the next result, returning true if it is available.
`void` | `reset()` Restarts response iterator.
`int` | `size()` Returns a number of results in the response.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### objectList

    protected java.util.List objectList

### currentIndex

    protected transient int currentIndex

Constructor Detail

### ListResponse

    public ListResponse()

  Creates an empty response.

### ListResponse

    public ListResponse(java.lang.Object object)

### ListResponse

    public ListResponse(java.util.List objectList)

Method Detail

### size

    public int size()

  Description copied from interface: `QueryResponse`
  Returns a number of results in the response.

  Specified by:
    `size` in interface `QueryResponse`

### isList

    public boolean isList()

  Description copied from interface: `QueryResponse`
  Returns whether current iteration result is a list or an update count.

  Specified by:
    `isList` in interface `QueryResponse`

### currentList

    public java.util.List currentList()

  Description copied from interface: `QueryResponse`
  Returns a List under the current iterator position. Use `QueryResponse.isList()` to check the result type before calling this method.

  Specified by:
    `currentList` in interface `QueryResponse`

### currentUpdateCount

    public int[] currentUpdateCount()

  Description copied from interface: `QueryResponse`
  Returns an update count under the current iterator position. Returned value is an int[] to accomodate batch queries. For a regular update result, the value will be an int[1]. Use `QueryResponse.isList()` to check the result type before calling this method.

  Specified by:
    `currentUpdateCount` in interface `QueryResponse`

### next

    public boolean next()

  Description copied from interface: `QueryResponse`
  Rewinds response iterator to the next result, returning true if it is available.

  Specified by:
    `next` in interface `QueryResponse`

### reset

    public void reset()

  Description copied from interface: `QueryResponse`
  Restarts response iterator.

  Specified by:
    `reset` in interface `QueryResponse`

### firstList

    public java.util.List firstList()

  Description copied from interface: `QueryResponse`
  A utility method for quickly retrieving the first list in the response. Note that this method resets current iterator to an undefined state.

  Specified by:
    `firstList` in interface `QueryResponse`

### firstUpdateCount

    public int[] firstUpdateCount()

  Description copied from interface: `QueryResponse`
  A utility method for quickly retrieving the first update count from the response. Note that this method resets current iterator to an undefined state.

  Specified by:
    `firstUpdateCount` in interface `QueryResponse`

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2001-2006 ObjectStyle.org All Rights Reserved.