Package net.rubyeye.xmemcached.impl
Class KeyIteratorImpl
- java.lang.Object
-
- net.rubyeye.xmemcached.impl.KeyIteratorImpl
-
- All Implemented Interfaces:
KeyIterator
public final class KeyIteratorImpl extends java.lang.Object implements KeyIterator
Default key iterator implementation
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.LinkedList<java.lang.String>
currentKeyList
private java.net.InetSocketAddress
inetSocketAddress
private java.util.LinkedList<java.lang.Integer>
itemNumbersList
private MemcachedClient
memcachedClient
private long
opTimeout
-
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 addressboolean
hasNext()
Check if the iterator has more keys.java.lang.String
next()
Get next key,if iterator has reached the end,throw ArrayIndexOutOfBoundsExceptionvoid
setOpTimeout(long opTimeout)
Set operation timeout,default is 1000 MILLISECONDS.
-
-
-
Field Detail
-
itemNumbersList
private final java.util.LinkedList<java.lang.Integer> itemNumbersList
-
currentKeyList
private java.util.LinkedList<java.lang.String> currentKeyList
-
memcachedClient
private final MemcachedClient memcachedClient
-
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 interfaceKeyIterator
- Returns:
-
setOpTimeout
public final void setOpTimeout(long opTimeout)
Description copied from interface:KeyIterator
Set operation timeout,default is 1000 MILLISECONDS.- Specified by:
setOpTimeout
in interfaceKeyIterator
-
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 interfaceKeyIterator
-
hasNext
public boolean hasNext()
Description copied from interface:KeyIterator
Check if the iterator has more keys.- Specified by:
hasNext
in interfaceKeyIterator
- 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 interfaceKeyIterator
- Returns:
- Throws:
MemcachedException
java.util.concurrent.TimeoutException
java.lang.InterruptedException
-
-