Class KeyIteratorImpl

  • All Implemented Interfaces:
    KeyIterator

    public final class KeyIteratorImpl
    extends java.lang.Object
    implements KeyIterator
    Default key iterator implementation
    • Constructor Summary

      Constructors 
      Constructor Description
      KeyIteratorImpl​(java.util.LinkedList<java.lang.Integer> itemNumbersList, MemcachedClient memcachedClient, java.net.InetSocketAddress inetSocketAddress)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()
      Close this iterator when you don't need it any more.It is not mandatory to call this method, but you might want to invoke this method for maximum performance.
      java.net.InetSocketAddress getServerAddress()
      Get current iterator's memcached server address
      boolean hasNext()
      Check if the iterator has more keys.
      java.lang.String next()
      Get next key,if iterator has reached the end,throw ArrayIndexOutOfBoundsException
      void setOpTimeout​(long opTimeout)
      Set operation timeout,default is 1000 MILLISECONDS.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • itemNumbersList

        private final java.util.LinkedList<java.lang.Integer> itemNumbersList
      • currentKeyList

        private java.util.LinkedList<java.lang.String> currentKeyList
      • inetSocketAddress

        private final java.net.InetSocketAddress inetSocketAddress
      • opTimeout

        private long opTimeout
    • Constructor Detail

      • KeyIteratorImpl

        public KeyIteratorImpl​(java.util.LinkedList<java.lang.Integer> itemNumbersList,
                               MemcachedClient memcachedClient,
                               java.net.InetSocketAddress inetSocketAddress)
    • Method Detail

      • getServerAddress

        public final java.net.InetSocketAddress getServerAddress()
        Description copied from interface: KeyIterator
        Get current iterator's memcached server address
        Specified by:
        getServerAddress in interface KeyIterator
        Returns:
      • setOpTimeout

        public final void setOpTimeout​(long opTimeout)
        Description copied from interface: KeyIterator
        Set operation timeout,default is 1000 MILLISECONDS.
        Specified by:
        setOpTimeout in interface KeyIterator
      • close

        public void close()
        Description copied from interface: KeyIterator
        Close this iterator when you don't need it any more.It is not mandatory to call this method, but you might want to invoke this method for maximum performance.
        Specified by:
        close in interface KeyIterator
      • hasNext

        public boolean hasNext()
        Description copied from interface: KeyIterator
        Check if the iterator has more keys.
        Specified by:
        hasNext in interface KeyIterator
        Returns:
      • next

        public java.lang.String next()
                              throws MemcachedException,
                                     java.util.concurrent.TimeoutException,
                                     java.lang.InterruptedException
        Description copied from interface: KeyIterator
        Get next key,if iterator has reached the end,throw ArrayIndexOutOfBoundsException
        Specified by:
        next in interface KeyIterator
        Returns:
        Throws:
        MemcachedException
        java.util.concurrent.TimeoutException
        java.lang.InterruptedException