Class ClientIterator

    • Constructor Summary

      Constructors 
      Constructor Description
      ClientIterator​(RemoteIterator remote, LocalAdapterFactory factory)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Creates a local adapter for the given remote iterator.
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      protected abstract Object getObject​(Object remote)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns a local adapter for the given remote object.
      long getPosition()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns the current position within the iterator.
      long getSize()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns the size (the total number of elements) of this iteration.
      boolean hasNext()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Checks if there are more elements in this iteration.
      Object next()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns the next element in this iteration.
      void remove()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Not supported.
      void skip​(long skipNum)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Skips the given number of elements in this iteration.
    • Constructor Detail

      • ClientIterator

        public ClientIterator​(RemoteIterator remote,
                              LocalAdapterFactory factory)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Creates a local adapter for the given remote iterator. The element buffer is initially empty.
        Parameters:
        remote - remote iterator
        factory - local adapter factory
    • Method Detail

      • getPosition

        public long getPosition()
        Deprecated, for removal: This API element is subject to removal in a future version.
        Returns the current position within the iterator.
        Specified by:
        getPosition in interface RangeIterator
        Returns:
        current position
        See Also:
        RangeIterator.getPosition()
      • getSize

        public long getSize()
                     throws RemoteRuntimeException
        Deprecated, for removal: This API element is subject to removal in a future version.
        Returns the size (the total number of elements) of this iteration. Returns -1 if the size is unknown.

        To minimize the number of remote method calls, the size is retrieved when this method is first called and cached for subsequent invocations.

        Specified by:
        getSize in interface RangeIterator
        Returns:
        number of elements in the iteration, or -1
        Throws:
        RemoteRuntimeException - on RMI errors
        See Also:
        RangeIterator.getSize()
      • skip

        public void skip​(long skipNum)
                  throws NoSuchElementException,
                         RemoteRuntimeException
        Deprecated, for removal: This API element is subject to removal in a future version.
        Skips the given number of elements in this iteration.

        The elements in the local element buffer are skipped first, and a remote skip method call is made only if more elements are being skipped than remain in the local buffer.

        Specified by:
        skip in interface RangeIterator
        Parameters:
        skipNum - the number of elements to skip
        Throws:
        NoSuchElementException - if skipped past the last element
        RemoteRuntimeException - on RMI errors
        See Also:
        RangeIterator.skip(long)
      • hasNext

        public boolean hasNext()
                        throws RemoteRuntimeException
        Deprecated, for removal: This API element is subject to removal in a future version.
        Checks if there are more elements in this iteration.
        Specified by:
        hasNext in interface Iterator
        Returns:
        true if there are more elements, false otherwise
        Throws:
        RemoteRuntimeException - on RMI errors
      • getObject

        protected abstract Object getObject​(Object remote)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Returns a local adapter for the given remote object. This abstract method is used by next() to convert the remote references returned by the remote iterator to local adapters.

        Subclasses should implement this method to use the local adapter factory to create local adapters of the specific element type.

        Parameters:
        remote - remote object
        Returns:
        local adapter