Package net.rubyeye.xmemcached.impl
Class KeyIteratorImpl
java.lang.Object
net.rubyeye.xmemcached.impl.KeyIteratorImpl
- All Implemented Interfaces:
KeyIterator
Default key iterator implementation
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate LinkedList
<String> private final InetSocketAddress
private final LinkedList
<Integer> private final MemcachedClient
private long
-
Constructor Summary
ConstructorsConstructorDescriptionKeyIteratorImpl
(LinkedList<Integer> itemNumbersList, MemcachedClient memcachedClient, InetSocketAddress inetSocketAddress) -
Method Summary
Modifier and TypeMethodDescriptionvoid
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.final InetSocketAddress
Get current iterator's memcached server addressboolean
hasNext()
Check if the iterator has more keys.next()
Get next key,if iterator has reached the end,throw ArrayIndexOutOfBoundsExceptionfinal void
setOpTimeout
(long opTimeout) Set operation timeout,default is 1000 MILLISECONDS.
-
Field Details
-
itemNumbersList
-
currentKeyList
-
memcachedClient
-
inetSocketAddress
-
opTimeout
private long opTimeout
-
-
Constructor Details
-
KeyIteratorImpl
public KeyIteratorImpl(LinkedList<Integer> itemNumbersList, MemcachedClient memcachedClient, InetSocketAddress inetSocketAddress)
-
-
Method Details
-
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
- Parameters:
opTimeout
-
-
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
Description copied from interface:KeyIterator
Get next key,if iterator has reached the end,throw ArrayIndexOutOfBoundsException- Specified by:
next
in interfaceKeyIterator
- Returns:
- Throws:
MemcachedException
TimeoutException
InterruptedException
-