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>currentKeyListprivate java.net.InetSocketAddressinetSocketAddressprivate java.util.LinkedList<java.lang.Integer>itemNumbersListprivate MemcachedClientmemcachedClientprivate longopTimeout
-
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 voidclose()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.InetSocketAddressgetServerAddress()Get current iterator's memcached server addressbooleanhasNext()Check if the iterator has more keys.java.lang.Stringnext()Get next key,if iterator has reached the end,throw ArrayIndexOutOfBoundsExceptionvoidsetOpTimeout(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: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
-
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
public java.lang.String next() throws MemcachedException, java.util.concurrent.TimeoutException, java.lang.InterruptedExceptionDescription copied from interface:KeyIteratorGet next key,if iterator has reached the end,throw ArrayIndexOutOfBoundsException- Specified by:
nextin interfaceKeyIterator- Returns:
- Throws:
MemcachedExceptionjava.util.concurrent.TimeoutExceptionjava.lang.InterruptedException
-
-