예제 #1
0
 @Override
 public V last() {
   V res = commandExecutor.read(getName(), codec, RedisCommands.LINDEX, getName(), -1);
   if (res == null) {
     throw new NoSuchElementException();
   }
   return res;
 }
예제 #2
0
 @Override
 public boolean contains(final Object o) {
   return commandExecutor.read(
       getName(),
       codec,
       new SyncOperation<Boolean>() {
         @Override
         public Boolean execute(Codec codec, RedisConnection conn) {
           return binarySearch((V) o, codec, conn).getIndex() >= 0;
         }
       });
 }
예제 #3
0
 private void loadComparator() {
   commandExecutor.read(
       getName(),
       codec,
       new SyncOperation<Void>() {
         @Override
         public Void execute(Codec codec, RedisConnection conn) {
           loadComparator(conn);
           return null;
         }
       });
 }
예제 #4
0
 @Override
 public <T> T[] toArray(T[] a) {
   List<V> res = commandExecutor.read(getName(), codec, RedisCommands.LRANGE, getName(), 0, -1);
   return res.toArray(a);
 }
예제 #5
0
 private V get(final int index) {
   return commandExecutor.read(getName(), codec, RedisCommands.LINDEX, getName(), index);
 }
예제 #6
0
 @Override
 public int size() {
   return commandExecutor.read(getName(), codec, RedisCommands.LLEN_INT, getName());
 }