Class ErrorGraphNodeList

All Implemented Interfaces:
Closeable, AutoCloseable, OsidList, OsidList, GraphNodeList

public final class ErrorGraphNodeList extends AbstractGraphNodeList implements GraphNodeList
This list is to implement an error condition through the OsidList interface.
  • Constructor Details

    • ErrorGraphNodeList

      public ErrorGraphNodeList(Exception e)
      Creates a new ErrorGraphNodeList.
      Parameters:
      e - an Exception
      Throws:
      NullArgumentException - e is null
    • ErrorGraphNodeList

      public ErrorGraphNodeList(String message)
      Creates a new ErrorGraphNodeList.
      Parameters:
      message - a text message for the exception
      Throws:
      NullArgumentException - message is null
    • ErrorGraphNodeList

      public ErrorGraphNodeList(String message, Exception e)
      Creates a new ErrorGraphNodeList.
      Parameters:
      message - a text message for the exception
      e - an exception
      Throws:
      NullArgumentException - message or e is null
  • Method Details

    • hasNext

      @OSID public boolean hasNext()
      Tests if there are more elements in this list.
      Specified by:
      hasNext in interface OsidList
      Specified by:
      hasNext in class AbstractOsidList
      Returns:
      true if more elements are available in this list, false if the end of the list has been reached
      Throws:
      IllegalStateException - this list is closed
    • available

      @OSID public long available()
      Gets the number of elements available for retrieval. The number returned by this method may be less than or equal to the total number of elements in this list. To determine if the end of the list has been reached, the method hasNext() should be used. This method conveys what is known about the number of remaining elements at a point in time and can be used to determine a minimum size of the remaining elements, if known. A valid return is zero even if hasNext() is true. This method does not imply asynchronous usage. All OSID methods may block.
      Specified by:
      available in interface OsidList
      Overrides:
      available in class AbstractOsidList
      Returns:
      the number of elements available for retrieval
      Throws:
      IllegalStateException - this list is closed
    • skip

      @OSID public void skip(long n)
      Skip the specified number of elements in the list. If the number skipped is greater than the number of elements in the list, hasNext() becomes false and available() returns zero as there are no more elements to retrieve.
      Specified by:
      skip in interface OsidList
      Overrides:
      skip in class AbstractGraphNodeList
      Parameters:
      n - the number of elements to skip
      Throws:
      InvalidArgumentException - n is less than zero
    • getNextGraphNode

      @OSID public GraphNode getNextGraphNode() throws OperationFailedException
      Gets the next GraphNode in this list.
      Specified by:
      getNextGraphNode in interface GraphNodeList
      Returns:
      the next GraphNode in this list. The hasNext() method should be used to test that a next GraphNode is available before calling this method.
      Throws:
      IllegalStateException - no more elements available in this list or this list is closed
      OperationFailedException - unable to complete request