ResultList
Date: 2016-02-29

de.zib.scalaris

## Class ResultList

- java.lang.Object
- - de.zib.scalaris.ResultList

- Direct Known Subclasses:
    Transaction.ResultList, TransactionSingleOp.ResultList

      public abstract class ResultList
      extends Object

  Generic result list.
  Since:
    3.5
  Version:
    3.8
  Author:
    Nico Kruber, kruber@zib.de

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Operation` | `get(int index)` Returns the operation at the specified position for e.g.
    `abstract void` | `processAddDelOnListAt(int pos)` Processes the result at the given position which originated from a add_del_on_list request.
    `abstract void` | `processAddOnNrAt(int pos)` Processes the result at the given position which originated from an add_on_nr request.
    `ErlangValue` | `processReadAt(int pos)` Processes the result at the given position which originated from a read request and returns the value that has been read.
    `abstract void` | `processTestAndSetAt(int pos)` Processes the result at the given position which originated from a test_and_set request.
    `abstract void` | `processWriteAt(int pos)` Processes the result at the given position which originated from a write request.
    `int` | `size()` Gets the number of results in the list.
    `String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Method Detail

    - #### size

          public int size()

      Gets the number of results in the list.
      Returns:
        total number of results

    - #### get

          public Operation get(int index)

      Returns the operation at the specified position for e.g. further result processing.
      Parameters:
        `index` - index of the operation/result to return
      Returns:
        the operation at the specified position
      Throws:
        `IndexOutOfBoundsException` - if the index is out of range ( `index < 0 || index >= size()`)
      Since:
        3.18

    - #### processReadAt

          public ErlangValue processReadAt(int pos)
                                    throws NotFoundException,
                                           UnknownException

      Processes the result at the given position which originated from a read request and returns the value that has been read.
      Parameters:
        `pos` - the position in the result list (starting at 0)
      Returns:
        the stored value
      Throws:
        `NotFoundException` - if the requested key does not exist
        `UnknownException` - if any other error occurs
      Since:
        3.13

    - #### processWriteAt

          public abstract void processWriteAt(int pos)
                                       throws AbortException,
                                              UnknownException

      Processes the result at the given position which originated from a write request.
      Parameters:
        `pos` - the position in the result list (starting at 0)
      Throws:
        `AbortException` - if the commit of the write failed (if there was a commit)
        `UnknownException` - if any other error occurs
      Since:
        3.13

    - #### processAddDelOnListAt

          public abstract void processAddDelOnListAt(int pos)
                                              throws NotAListException,
                                                     AbortException,
                                                     UnknownException

      Processes the result at the given position which originated from a add_del_on_list request.
      Parameters:
        `pos` - the position in the result list (starting at 0)
      Throws:
        `NotAListException` - if the previously stored value was no list
        `AbortException` - if the commit of the write failed (if there was a commit)
        `UnknownException` - if any other error occurs
      Since:
        3.13

    - #### processAddOnNrAt

          public abstract void processAddOnNrAt(int pos)
                                         throws NotANumberException,
                                                AbortException,
                                                UnknownException

      Processes the result at the given position which originated from an add_on_nr request.
      Parameters:
        `pos` - the position in the result list (starting at 0)
      Throws:
        `NotANumberException` - if the previously stored value was not a number
        `AbortException` - if the commit of the write failed (if there was a commit)
        `UnknownException` - if any other error occurs
      Since:
        3.13

    - #### processTestAndSetAt

          public abstract void processTestAndSetAt(int pos)
                                            throws NotFoundException,
                                                   KeyChangedException,
                                                   AbortException,
                                                   UnknownException

      Processes the result at the given position which originated from a test_and_set request.
      Parameters:
        `pos` - the position in the result list (starting at 0)
      Throws:
        `NotFoundException` - if the requested key does not exist
        `KeyChangedException` - if the key did not match `old_value`
        `AbortException` - if the commit of the write failed (if there was a commit)
        `UnknownException` - if any other error occurs
      Since:
        3.13

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`