项目:presto
文件:AbstractTestOrcReader.java
项目: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
/**
* 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
项目:codebuff
文件:LocalCache.java
项目:codebuff
文件:LocalCache.java
项目:codebuff
文件:LocalCache.java
项目: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
项目:owsi-core-parent
文件:CsvRow.java
项目:bts
文件:LocalCache.java
项目:bts
文件:LocalCache.java
项目:j2objc
文件:LocalCache.java
项目:j2objc
文件:LocalCache.java
项目:guava-libraries
文件:LocalCache.java
项目:guava-libraries
文件:LocalCache.java
项目:mclab-core
文件:TokenStreamFragment.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
项目:VectorAttackScanner
文件:LocalCache.java
项目:guava
文件:LocalCache.java
项目:guava
文件:LocalCache.java
项目:cnGuava
文件:LocalCache.java
项目:cnGuava
文件:LocalCache.java
项目: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();
}
};
}
};
}
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;
}
};
}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。