Overview | Package | Class | Tree | Deprecated | Index | Help
| XCC/J 4.2-9
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.marklogic.xcc
Interface ResultItem

All Superinterfaces:
  XdmItem, XdmValue

    public interface ResultItem

extends XdmItem

An `XdmItem` that is a member of a `ResultSequence`. The values associated with ResultItem instances may be transient. ResultItem wraps an `XdmItem` instance and also implements the `XdmItem` interface. Invoking the methods of the `XdmItem` interface are passed through to the contained instance.

Because a `ResultSequence` may be streaming, the contained `XdmItem` may be have been partially consumed. Use the `isFetchable()` method to determine if it is safe to access the value.

See Also:
  `com.marklogic.xcc.types`

Method Summary
`void` | `cache()` If this item is not already cached, read it fully from the result stream so that it is buffered in memory.
`int` | `getIndex()` The position (zero-based) of this ResultItem in its containing `ResultSequence`.
`XdmItem` | `getItem()` Returns the actual `XdmItem` value wrapped by this ResultItem.
`boolean` | `isFetchable()` Indicates if the value of this ResultItem may be fetched.

Methods inherited from interface com.marklogic.xcc.types.XdmItem
`asInputStream, asReader, getItemType, isCached, writeTo, writeTo`

Methods inherited from interface com.marklogic.xcc.types.XdmValue
`asString, getValueType`

Method Detail

### getItem

    XdmItem getItem()

  Returns the actual `XdmItem` value wrapped by this ResultItem. The instance returned may be tested with `instanceof`.

  Returns:
    an instance of `XdmItem`.

### getIndex

    int getIndex()

  The position (zero-based) of this ResultItem in its containing `ResultSequence`.

  Returns:
    This ResultItem's positional index.

### isFetchable

    boolean isFetchable()

  Indicates if the value of this ResultItem may be fetched. For large values that are streamed, this method will return false after `XdmItem.asInputStream()` or `XdmItem.asReader()` is called.

  Returns:
    true if the XdmItem may be fetched, false if not. This will always be true if isCached() is true. It will also always be true immediately after `ResultSequence.next()` is called and returns this `XdmItem`.

### cache

    void cache()

  If this item is not already cached, read it fully from the result stream so that it is buffered in memory. If the item is already cached, this is a no-op.

  Throws:
    `StreamingResultException` - If an IOException ocurrs reading the result data.

Overview | Package | Class | Tree | Deprecated | Index | Help
| XCC/J 4.2-9
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2003-2012 MarkLogic Corporation, All Rights Reserved.

Complete online documentation for MarkLogic Server, XQuery and related components may be found at developer.marklogic.com