Java 类com.google.common.collect.AbstractSequentialIterator 实例源码

项目:presto    文件:AbstractTestOrcReader.java   
private static Iterable<Double> doubleSequence(double start, double step, int items)
{
    return () -> new AbstractSequentialIterator<Double>(start)
    {
        private int item;

        @Override
        protected Double computeNext(Double previous)
        {
            if (item >= items) {
                return null;
            }
            item++;
            return previous + step;
        }
    };
}
项目:guava-mock    文件:LocalCache.java   
@Override
public Iterator<ReferenceEntry<K, V>> iterator() {
  return new AbstractSequentialIterator<ReferenceEntry<K, V>>(peek()) {
    @Override
    protected ReferenceEntry<K, V> computeNext(ReferenceEntry<K, V> previous) {
      ReferenceEntry<K, V> next = previous.getNextInWriteQueue();
      return (next == head) ? null : next;
    }
  };
}
项目:guava-mock    文件:LocalCache.java   
@Override
public Iterator<ReferenceEntry<K, V>> iterator() {
  return new AbstractSequentialIterator<ReferenceEntry<K, V>>(peek()) {
    @Override
    protected ReferenceEntry<K, V> computeNext(ReferenceEntry<K, V> previous) {
      ReferenceEntry<K, V> next = previous.getNextInAccessQueue();
      return (next == head) ? null : next;
    }
  };
}
项目:googles-monorepo-demo    文件:LocalCache.java   
@Override
public Iterator<ReferenceEntry<K, V>> iterator() {
  return new AbstractSequentialIterator<ReferenceEntry<K, V>>(peek()) {
    @Override
    protected ReferenceEntry<K, V> computeNext(ReferenceEntry<K, V> previous) {
      ReferenceEntry<K, V> next = previous.getNextInWriteQueue();
      return (next == head) ? null : next;
    }
  };
}
项目:googles-monorepo-demo    文件:LocalCache.java   
@Override
public Iterator<ReferenceEntry<K, V>> iterator() {
  return new AbstractSequentialIterator<ReferenceEntry<K, V>>(peek()) {
    @Override
    protected ReferenceEntry<K, V> computeNext(ReferenceEntry<K, V> previous) {
      ReferenceEntry<K, V> next = previous.getNextInAccessQueue();
      return (next == head) ? null : next;
    }
  };
}
项目:Mastering-Mesos    文件:ShiroAuthorizingParamInterceptor.java   
/**
 * Return each method in the inheritance hierarchy of method in the order described by
 * {@link AuthorizingParam}.
 *
 * @see org.apache.aurora.scheduler.http.api.security.AuthorizingParam
 */
private static Iterable<Method> getCandidateMethods(final Method method) {
  return () -> new AbstractSequentialIterator<Method>(method) {
    @Override
    protected Method computeNext(Method previous) {
      String name = previous.getName();
      Class<?>[] parameterTypes = previous.getParameterTypes();
      Class<?> declaringClass = previous.getDeclaringClass();

      if (declaringClass.isInterface()) {
        return null;
      }

      Iterable<Class<?>> searchOrder = ImmutableList.<Class<?>>builder()
          .addAll(Optional.fromNullable(declaringClass.getSuperclass()).asSet())
          .addAll(ImmutableList.copyOf(declaringClass.getInterfaces()))
          .build();

      for (Class<?> klazz : searchOrder) {
        try {
          return klazz.getMethod(name, parameterTypes);
        } catch (NoSuchMethodException ignored) {
          // Expected.
        }
      }

      return null;
    }
  };
}
项目:codebuff    文件:LocalCache.java   
@Override
public Iterator<ReferenceEntry<K, V>> iterator() {
  return new AbstractSequentialIterator<ReferenceEntry<K, V>>(peek()) {
    @Override
    protected ReferenceEntry<K, V> computeNext(ReferenceEntry<K, V> previous) {
      ReferenceEntry<K, V> next = previous.getNextInWriteQueue();
      return (next == head) ? null : next;
    }
  };
}
项目:codebuff    文件:LocalCache.java   
@Override
public Iterator<ReferenceEntry<K, V>> iterator() {
  return new AbstractSequentialIterator<ReferenceEntry<K, V>>(peek()) {
    @Override
    protected ReferenceEntry<K, V> computeNext(ReferenceEntry<K, V> previous) {
      ReferenceEntry<K, V> next = previous.getNextInAccessQueue();
      return (next == head) ? null : next;
    }
  };
}
项目:codebuff    文件:LocalCache.java   
@Override
public Iterator<ReferenceEntry<K, V>> iterator() {
  return new AbstractSequentialIterator<ReferenceEntry<K, V>>(peek()) {
    @Override
    protected ReferenceEntry<K, V> computeNext(ReferenceEntry<K, V> previous) {
      ReferenceEntry<K, V> next = previous.getNextInWriteQueue();
      return (next == head) ? null : next;
    }
  };
}
项目:codebuff    文件:LocalCache.java   
@Override
public Iterator<ReferenceEntry<K, V>> iterator() {
  return new AbstractSequentialIterator<ReferenceEntry<K, V>>(peek()) {
    @Override
    protected ReferenceEntry<K, V> computeNext(ReferenceEntry<K, V> previous) {
      ReferenceEntry<K, V> next = previous.getNextInAccessQueue();
      return (next == head) ? null : next;
    }
  };
}
项目:codebuff    文件:LocalCache.java   
@Override
public Iterator<ReferenceEntry<K, V>> iterator() {
  return new AbstractSequentialIterator<ReferenceEntry<K, V>>(peek()) {
    @Override
    protected ReferenceEntry<K, V> computeNext(ReferenceEntry<K, V> previous) {
      ReferenceEntry<K, V> next = previous.getNextInWriteQueue();
      return (next == head) ? null : next;
    }
  };
}
项目:codebuff    文件:LocalCache.java   
@Override
public Iterator<ReferenceEntry<K, V>> iterator() {
  return new AbstractSequentialIterator<ReferenceEntry<K, V>>(peek()) {
    @Override
    protected ReferenceEntry<K, V> computeNext(ReferenceEntry<K, V> previous) {
      ReferenceEntry<K, V> next = previous.getNextInAccessQueue();
      return (next == head) ? null : next;
    }
  };
}
项目:codebuff    文件:LocalCache.java   
@Override
public Iterator<ReferenceEntry<K, V>> iterator() {
                     return new AbstractSequentialIterator<ReferenceEntry<K, V>>(peek()) {
                                                                                        @Override
                                                                                        protected ReferenceEntry<K, V> computeNext(ReferenceEntry<K, V> previous) {
                         ReferenceEntry<K, V> next = previous.getNextInWriteQueue();
                         return (next == head) ? null : next;
                                                                                        }
                     };
}
项目:codebuff    文件:LocalCache.java   
@Override
public Iterator<ReferenceEntry<K, V>> iterator() {
                     return new AbstractSequentialIterator<ReferenceEntry<K, V>>(peek()) {
                                                                                         @Override
                                                                                         protected ReferenceEntry<K, V> computeNext(ReferenceEntry<K, V> previous) {
                         ReferenceEntry<K, V> next = previous.getNextInAccessQueue();
                         return (next == head) ? null : next;
                                                                                         }
                     };
}
项目:codebuff    文件:LocalCache.java   
@Override
public Iterator<ReferenceEntry<K, V>> iterator() {
  return new AbstractSequentialIterator<ReferenceEntry<K, V>>(peek()) {
    @Override
    protected ReferenceEntry<K, V> computeNext(ReferenceEntry<K, V> previous) {
      ReferenceEntry<K, V> next = previous.getNextInWriteQueue();
      return (next == head) ? null : next;
    }
  };
}
项目:codebuff    文件:LocalCache.java   
@Override
public Iterator<ReferenceEntry<K, V>> iterator() {
  return new AbstractSequentialIterator<ReferenceEntry<K, V>>(peek()) {
    @Override
    protected ReferenceEntry<K, V> computeNext(ReferenceEntry<K, V> previous) {
      ReferenceEntry<K, V> next = previous.getNextInAccessQueue();
      return (next == head) ? null : next;
    }
  };
}
项目:codebuff    文件:LocalCache.java   
@Override
public Iterator<ReferenceEntry<K, V>> iterator() {
  return new AbstractSequentialIterator<ReferenceEntry<K, V>>(peek()) {
    @Override
    protected ReferenceEntry<K, V> computeNext(ReferenceEntry<K, V> previous) {
      ReferenceEntry<K, V> next = previous.getNextInWriteQueue();
      return (next == head) ? null : next;
    }
  };
}
项目:codebuff    文件:LocalCache.java   
@Override
public Iterator<ReferenceEntry<K, V>> iterator() {
  return new AbstractSequentialIterator<ReferenceEntry<K, V>>(peek()) {
    @Override
    protected ReferenceEntry<K, V> computeNext(ReferenceEntry<K, V> previous) {
      ReferenceEntry<K, V> next = previous.getNextInAccessQueue();
      return (next == head) ? null : next;
    }
  };
}
项目:nomulus    文件:CidrAddressBlock.java   
@Override
public Iterator<InetAddress> iterator() {
  return new AbstractSequentialIterator<InetAddress>(ip) {
    @Override
    protected InetAddress computeNext(InetAddress previous) {
      if (InetAddresses.isMaximum(previous)) {
        return null;
      }

      InetAddress next = InetAddresses.increment(previous);
      return (contains(next)) ? next : null;
    }
  };
}
项目:owsi-core-parent    文件:CsvTable.java   
@Override
public Iterator<CsvRow> iterator() {
    return new AbstractSequentialIterator<CsvRow>(getRow(0)) {
        @Override
        protected CsvRow computeNext(CsvRow previous) {
            return getRow(previous.getIndex() + 1);
        }
    };
}
项目:owsi-core-parent    文件:CsvRow.java   
@Override
public Iterator<CsvCell> iterator() {
    return new AbstractSequentialIterator<CsvCell>(getCell(0)) {
        @Override
        protected CsvCell computeNext(CsvCell previous) {
            return getCell(previous.getIndex() + 1);
        }
    };
}
项目:bts    文件:LocalCache.java   
@Override
public Iterator<ReferenceEntry<K, V>> iterator() {
  return new AbstractSequentialIterator<ReferenceEntry<K, V>>(peek()) {
    @Override
    protected ReferenceEntry<K, V> computeNext(ReferenceEntry<K, V> previous) {
      ReferenceEntry<K, V> next = previous.getNextInWriteQueue();
      return (next == head) ? null : next;
    }
  };
}
项目:bts    文件:LocalCache.java   
@Override
public Iterator<ReferenceEntry<K, V>> iterator() {
  return new AbstractSequentialIterator<ReferenceEntry<K, V>>(peek()) {
    @Override
    protected ReferenceEntry<K, V> computeNext(ReferenceEntry<K, V> previous) {
      ReferenceEntry<K, V> next = previous.getNextInAccessQueue();
      return (next == head) ? null : next;
    }
  };
}
项目:j2objc    文件:LocalCache.java   
@Override
public Iterator<ReferenceEntry<K, V>> iterator() {
  return new AbstractSequentialIterator<ReferenceEntry<K, V>>(peek()) {
    @Override
    protected ReferenceEntry<K, V> computeNext(ReferenceEntry<K, V> previous) {
      ReferenceEntry<K, V> next = previous.getNextInWriteQueue();
      return (next == head) ? null : next;
    }
  };
}
项目:j2objc    文件:LocalCache.java   
@Override
public Iterator<ReferenceEntry<K, V>> iterator() {
  return new AbstractSequentialIterator<ReferenceEntry<K, V>>(peek()) {
    @Override
    protected ReferenceEntry<K, V> computeNext(ReferenceEntry<K, V> previous) {
      ReferenceEntry<K, V> next = previous.getNextInAccessQueue();
      return (next == head) ? null : next;
    }
  };
}
项目:guava-libraries    文件:LocalCache.java   
@Override
public Iterator<ReferenceEntry<K, V>> iterator() {
  return new AbstractSequentialIterator<ReferenceEntry<K, V>>(peek()) {
    @Override
    protected ReferenceEntry<K, V> computeNext(ReferenceEntry<K, V> previous) {
      ReferenceEntry<K, V> next = previous.getNextInWriteQueue();
      return (next == head) ? null : next;
    }
  };
}
项目:guava-libraries    文件:LocalCache.java   
@Override
public Iterator<ReferenceEntry<K, V>> iterator() {
  return new AbstractSequentialIterator<ReferenceEntry<K, V>>(peek()) {
    @Override
    protected ReferenceEntry<K, V> computeNext(ReferenceEntry<K, V> previous) {
      ReferenceEntry<K, V> next = previous.getNextInAccessQueue();
      return (next == head) ? null : next;
    }
  };
}
项目:mclab-core    文件:TokenStreamFragment.java   
public Iterator<TokenStreamFragment.Node> iterator() {
  return new AbstractSequentialIterator<TokenStreamFragment.Node>(getStart()) {
    @Override protected TokenStreamFragment.Node computeNext(TokenStreamFragment.Node previous) {
      return previous == getEnd() ? null : previous.getNext();
    }
  };
}
项目:presto    文件:PrestoS3FileSystem.java   
private Iterator<LocatedFileStatus> listPrefix(Path path)
{
    String key = keyFromPath(path);
    if (!key.isEmpty()) {
        key += "/";
    }

    ListObjectsRequest request = new ListObjectsRequest()
            .withBucketName(uri.getHost())
            .withPrefix(key)
            .withDelimiter("/");

    STATS.newListObjectsCall();
    Iterator<ObjectListing> listings = new AbstractSequentialIterator<ObjectListing>(s3.listObjects(request))
    {
        @Override
        protected ObjectListing computeNext(ObjectListing previous)
        {
            if (!previous.isTruncated()) {
                return null;
            }
            return s3.listNextBatchOfObjects(previous);
        }
    };

    return Iterators.concat(Iterators.transform(listings, this::statusFromListing));
}
项目:VectorAttackScanner    文件:LocalCache.java   
@Override
public Iterator<ReferenceEntry<K, V>> iterator() {
  return new AbstractSequentialIterator<ReferenceEntry<K, V>>(peek()) {
    @Override
    protected ReferenceEntry<K, V> computeNext(ReferenceEntry<K, V> previous) {
      ReferenceEntry<K, V> next = previous.getNextInWriteQueue();
      return (next == head) ? null : next;
    }
  };
}
项目:VectorAttackScanner    文件:LocalCache.java   
@Override
public Iterator<ReferenceEntry<K, V>> iterator() {
  return new AbstractSequentialIterator<ReferenceEntry<K, V>>(peek()) {
    @Override
    protected ReferenceEntry<K, V> computeNext(ReferenceEntry<K, V> previous) {
      ReferenceEntry<K, V> next = previous.getNextInAccessQueue();
      return (next == head) ? null : next;
    }
  };
}
项目:guava    文件:LocalCache.java   
@Override
public Iterator<ReferenceEntry<K, V>> iterator() {
  return new AbstractSequentialIterator<ReferenceEntry<K, V>>(peek()) {
    @Override
    protected ReferenceEntry<K, V> computeNext(ReferenceEntry<K, V> previous) {
      ReferenceEntry<K, V> next = previous.getNextInWriteQueue();
      return (next == head) ? null : next;
    }
  };
}
项目:guava    文件:LocalCache.java   
@Override
public Iterator<ReferenceEntry<K, V>> iterator() {
  return new AbstractSequentialIterator<ReferenceEntry<K, V>>(peek()) {
    @Override
    protected ReferenceEntry<K, V> computeNext(ReferenceEntry<K, V> previous) {
      ReferenceEntry<K, V> next = previous.getNextInAccessQueue();
      return (next == head) ? null : next;
    }
  };
}
项目:guava    文件:LocalCache.java   
@Override
public Iterator<ReferenceEntry<K, V>> iterator() {
  return new AbstractSequentialIterator<ReferenceEntry<K, V>>(peek()) {
    @Override
    protected ReferenceEntry<K, V> computeNext(ReferenceEntry<K, V> previous) {
      ReferenceEntry<K, V> next = previous.getNextInWriteQueue();
      return (next == head) ? null : next;
    }
  };
}
项目:guava    文件:LocalCache.java   
@Override
public Iterator<ReferenceEntry<K, V>> iterator() {
  return new AbstractSequentialIterator<ReferenceEntry<K, V>>(peek()) {
    @Override
    protected ReferenceEntry<K, V> computeNext(ReferenceEntry<K, V> previous) {
      ReferenceEntry<K, V> next = previous.getNextInAccessQueue();
      return (next == head) ? null : next;
    }
  };
}
项目:cnGuava    文件:LocalCache.java   
@Override
public Iterator<ReferenceEntry<K, V>> iterator() {
    return new AbstractSequentialIterator<ReferenceEntry<K, V>>(peek()) {
        @Override
        protected ReferenceEntry<K, V> computeNext(ReferenceEntry<K, V> previous) {
            ReferenceEntry<K, V> next = previous.getNextInWriteQueue();
            return (next == head) ? null : next;
        }
    };
}
项目:cnGuava    文件:LocalCache.java   
@Override
public Iterator<ReferenceEntry<K, V>> iterator() {
    return new AbstractSequentialIterator<ReferenceEntry<K, V>>(peek()) {
        @Override
        protected ReferenceEntry<K, V> computeNext(ReferenceEntry<K, V> previous) {
            ReferenceEntry<K, V> next = previous.getNextInAccessQueue();
            return (next == head) ? null : next;
        }
    };
}
项目:bytecodelib    文件:Klass.java   
/**
 * Returns an iterable of all superclasses of this class, in ascending
 * order; thus, the first class is the immediate superclass.
 * @return an an iterable of all superclasses of this class
 */
public Iterable<Klass> superclasses() {
    return new Iterable<Klass>() {
        @Override
        public Iterator<Klass> iterator() {
            return new AbstractSequentialIterator<Klass>(getSuperclass()) {
                @Override
                protected Klass computeNext(Klass previous) {
                    return previous.getSuperclass();
                }
            };
        }
    };
}
项目:spliceengine    文件:PrestoS3FileSystem.java   
private Iterator<LocatedFileStatus> listPrefix(Path path)
{
    String key = keyFromPath(path);
    if (!key.isEmpty()) {
        key += PATH_SEPARATOR;
    }

    ListObjectsRequest request = new ListObjectsRequest()
            .withBucketName(uri.getHost())
            .withPrefix(key)
            .withDelimiter(PATH_SEPARATOR);

    STATS.newListObjectsCall();
    Iterator<ObjectListing> listings = new AbstractSequentialIterator<ObjectListing>(s3.listObjects(request))
    {
        @Override
        protected ObjectListing computeNext(ObjectListing previous)
        {
            if (!previous.isTruncated()) {
                return null;
            }
            return s3.listNextBatchOfObjects(previous);
        }
    };

    return Iterators.concat(Iterators.transform(listings, this::statusFromListing));
}
项目:googleads-java-lib    文件:ProductPartitionTreeImpl.java   
/**
 * Constructor that initializes the temp ID generator based on the ID of the root node.
 *
 * @param adGroupId the ID of the ad group
 * @param biddingStrategyConfig the bidding strategy configuration of the ad group
 * @param rootNode the root node of the tree
 */
ProductPartitionTreeImpl(long adGroupId, BiddingStrategyConfiguration biddingStrategyConfig,
    ProductPartitionNode rootNode) {
  this.adGroupId = adGroupId;
  this.biddingStrategyConfig =
      Preconditions.checkNotNull(biddingStrategyConfig, "Null bidding strategy configuration");
  this.root = Preconditions.checkNotNull(rootNode, "Null root node");

  long startingTempId;
  this.dimensionComparator = new ProductDimensionComparator();
  if (this.root.getProductPartitionId() < 0L) {
    // The root has a temporary ID, so all changes made to this tree should result in ADD
    // operations.
    originalRoot = null;
    startingTempId = -1L;
  } else {
    // Set originalRoot to a deep copy of the root node.
    originalRoot =
        new ProductPartitionNode(null, root.getDimension(), root.getProductPartitionId(),
            this.dimensionComparator);
    long minimumId = cloneChildrenToNewParent(originalRoot, root.getChildren(),
        originalRoot.getProductPartitionId());
    // The starting temp ID should be -1 if all nodes are non-temporary (have positive IDs),
    // else start at one less than the lowest ID found in the tree.
    startingTempId = minimumId >= 0L ? -1L : minimumId - 1L;
  }
  this.idGenerator = new AbstractSequentialIterator<Long>(startingTempId) {
    @Override
    protected Long computeNext(Long previous) {
      return Long.MIN_VALUE == previous.longValue() ? null : previous - 1;
    }
  };
}