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 InetSocketAddressprivate final LinkedList<Integer> private final MemcachedClientprivate long -
Constructor Summary
ConstructorsConstructorDescriptionKeyIteratorImpl(LinkedList<Integer> itemNumbersList, MemcachedClient memcachedClient, InetSocketAddress inetSocketAddress) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()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 InetSocketAddressGet current iterator's memcached server addressbooleanhasNext()Check if the iterator has more keys.next()Get next key,if iterator has reached the end,throw ArrayIndexOutOfBoundsExceptionfinal voidsetOpTimeout(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:KeyIteratorGet current iterator's memcached server address- Specified by:
getServerAddressin interfaceKeyIterator- Returns:
-
setOpTimeout
public final void setOpTimeout(long opTimeout) Description copied from interface:KeyIteratorSet operation timeout,default is 1000 MILLISECONDS.- Specified by:
setOpTimeoutin interfaceKeyIterator- Parameters:
opTimeout-
-
close
public void close()Description copied from interface:KeyIteratorClose 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:
closein interfaceKeyIterator
-
hasNext
public boolean hasNext()Description copied from interface:KeyIteratorCheck if the iterator has more keys.- Specified by:
hasNextin interfaceKeyIterator- Returns:
-
next
Description copied from interface:KeyIteratorGet next key,if iterator has reached the end,throw ArrayIndexOutOfBoundsException- Specified by:
nextin interfaceKeyIterator- Returns:
- Throws:
MemcachedExceptionTimeoutExceptionInterruptedException
-