From d479253768d296a40b4f699e1de9b03c7146a97a Mon Sep 17 00:00:00 2001 From: Jesse Morgan Date: Tue, 3 Dec 2013 14:03:28 -0800 Subject: Adding javadocs and Carbonado User Guide --- apidocs/com/amazon/carbonado/Cursor.html | 431 +++++++++++++++++++++++++++++++ 1 file changed, 431 insertions(+) create mode 100644 apidocs/com/amazon/carbonado/Cursor.html (limited to 'apidocs/com/amazon/carbonado/Cursor.html') diff --git a/apidocs/com/amazon/carbonado/Cursor.html b/apidocs/com/amazon/carbonado/Cursor.html new file mode 100644 index 0000000..0230910 --- /dev/null +++ b/apidocs/com/amazon/carbonado/Cursor.html @@ -0,0 +1,431 @@ + + + + + + +Cursor (Carbonado 1.2.3 API) + + + + + + + +
+ + + + + +
+ + + +
+
com.amazon.carbonado
+

Interface Cursor<S>

+
+
+
+
    +
  • +
    +
    All Known Implementing Classes:
    +
    AbstractCursor, ControllerCursor, DifferenceCursor, EmptyCursor, FetchAheadCursor, FilteredCursor, GroupedCursor, IntersectionCursor, IteratorCursor, LimitCursor, MultiTransformedCursor, RawCursor, SingletonCursor, SkipCursor, SortedCursor, SymmetricDifferenceCursor, ThrottledCursor, TransformedCursor, UnionCursor
    +
    +
    +
    +
    public interface Cursor<S>
    +
    Represents the results of a Query's fetch + operation. Cursors must be closed promptly when no longer + needed. Failure to do so may result in excessive resource consumption or + deadlock. As a convenience, the close operation is automatically performed + when the end is reached or when an exception is thrown. + +

    Note: because a Cursor manages resources, it is inapproprate to create a long-lived one and + pass it around in your code. A cursor is expected to live close to the Query which vended + it. To discourage inappropriate retention, the cursor does not implement methods (like + "getQuery" or "reset") which would make it more convenient to operate on in isolation. + +

    Similarly, it is difficult to guarantee that the results of a cursor will + be the same in case of a "reset" or reverse iteration. For this reason, + neither is supported; if you need to iterate the same set of objects twice, + simply retain the query object and reissue it. Be aware that the results may + not be identical, if any relevant objects are added to or removed the + repository in the interim. To guard against this, operate within a + serializable isolation level. + +

    Cursor instances are mutable and not guaranteed to be thread-safe. Only + one thread should ever operate on a cursor instance.

    +
    Author:
    +
    Brian S O'Neill, Don Schneider
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      Methods 
      Modifier and TypeMethod and Description
      voidclose() +
      Call close to release any resources being held by this cursor.
      +
      intcopyInto(java.util.Collection<? super S> c) +
      Copies all remaining next elements into the given collection.
      +
      intcopyInto(java.util.Collection<? super S> c, + int limit) +
      Copies a limited amount of remaining next elements into the given + collection.
      +
      booleanhasNext() +
      Returns true if this cursor has more elements.
      +
      Snext() +
      Returns the next element from this cursor.
      +
      intskipNext(int amount) +
      Skips forward by the specified amount of elements, returning the actual + amount skipped.
      +
      java.util.List<S>toList() +
      Copies all remaining next elements into a new modifiable list.
      +
      java.util.List<S>toList(int limit) +
      Copies a limited amount of remaining next elements into a new modifiable + list.
      +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        close

        +
        void close()
        +           throws FetchException
        +
        Call close to release any resources being held by this cursor. Further + operations on this cursor will behave as if there are no results.
        +
        Throws:
        +
        FetchException
        +
      • +
      + + + +
        +
      • +

        hasNext

        +
        boolean hasNext()
        +                throws FetchException
        +
        Returns true if this cursor has more elements. In other words, returns + true if next would return an element rather than throwing + an exception.
        +
        Throws:
        +
        FetchException - if storage layer throws an exception
        +
      • +
      + + + +
        +
      • +

        next

        +
        S next()
        +       throws FetchException
        +
        Returns the next element from this cursor. This method may be called + repeatedly to iterate through the results.
        +
        Throws:
        +
        FetchException - if storage layer throws an exception
        +
        java.util.NoSuchElementException - if the cursor has no next element.
        +
      • +
      + + + +
        +
      • +

        skipNext

        +
        int skipNext(int amount)
        +             throws FetchException
        +
        Skips forward by the specified amount of elements, returning the actual + amount skipped. The actual amount is less than the requested amount only + if the end of the results was reached.
        +
        Parameters:
        amount - maximum amount of elements to skip
        +
        Returns:
        actual amount skipped
        +
        Throws:
        +
        FetchException - if storage layer throws an exception
        +
        java.lang.IllegalArgumentException - if amount is negative
        +
      • +
      + + + +
        +
      • +

        copyInto

        +
        int copyInto(java.util.Collection<? super S> c)
        +             throws FetchException
        +
        Copies all remaining next elements into the given collection. This + method is roughly equivalent to the following: +
        + Cursor cursor;
        + ...
        + while (cursor.hasNext()) {
        +     c.add(cursor.next());
        + }
        + 
        + +

        As a side-effect of calling this method, the cursor is closed.

        +
        Returns:
        actual amount of results added
        +
        Throws:
        +
        FetchException - if storage layer throws an exception
        +
      • +
      + + + +
        +
      • +

        copyInto

        +
        int copyInto(java.util.Collection<? super S> c,
        +           int limit)
        +             throws FetchException
        +
        Copies a limited amount of remaining next elements into the given + collection. This method is roughly equivalent to the following: +
        + Cursor cursor;
        + ...
        + while (--limit >= 0 && cursor.hasNext()) {
        +     c.add(cursor.next());
        + }
        + 
        +
        Parameters:
        limit - maximum amount of elements to copy
        +
        Returns:
        actual amount of results added
        +
        Throws:
        +
        FetchException - if storage layer throws an exception
        +
        java.lang.IllegalArgumentException - if limit is negative
        +
      • +
      + + + +
        +
      • +

        toList

        +
        java.util.List<S> toList()
        +                         throws FetchException
        +
        Copies all remaining next elements into a new modifiable list. This + method is roughly equivalent to the following: +
        + Cursor<S> cursor;
        + ...
        + List<S> list = new ...
        + cursor.copyInto(list);
        + 
        + +

        As a side-effect of calling this method, the cursor is closed.

        +
        Returns:
        a new modifiable list
        +
        Throws:
        +
        FetchException - if storage layer throws an exception
        +
      • +
      + + + +
        +
      • +

        toList

        +
        java.util.List<S> toList(int limit)
        +                         throws FetchException
        +
        Copies a limited amount of remaining next elements into a new modifiable + list. This method is roughly equivalent to the following: +
        + Cursor<S> cursor;
        + ...
        + List<S> list = new ...
        + cursor.copyInto(list, limit);
        + 
        +
        Parameters:
        limit - maximum amount of elements to copy
        +
        Returns:
        a new modifiable list
        +
        Throws:
        +
        FetchException - if storage layer throws an exception
        +
        java.lang.IllegalArgumentException - if limit is negative
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + +
+ + +

Copyright © 2006-2013 Amazon Technologies, Inc.. All Rights Reserved.

+ + -- cgit v1.2.3