本文整理汇总了Java中com.google.common.collect.Iterators.unmodifiableIterator方法的典型用法代码示例。如果您正苦于以下问题:Java Iterators.unmodifiableIterator方法的具体用法?Java Iterators.unmodifiableIterator怎么用?Java Iterators.unmodifiableIterator使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.common.collect.Iterators
的用法示例。
在下文中一共展示了Iterators.unmodifiableIterator方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: entrySet
import com.google.common.collect.Iterators; //导入方法依赖的package包/类
@Override
public Set<Map.Entry<NameAndAccess, TMember>> entrySet() {
return new AbstractSet<Map.Entry<NameAndAccess, TMember>>() {
@Override
public Iterator<Map.Entry<NameAndAccess, TMember>> iterator() {
return Iterators.unmodifiableIterator(
new TransformedIterator2<TMember, Map.Entry<NameAndAccess, TMember>>(members.iterator()) {
@Override
protected Map.Entry<NameAndAccess, TMember> transform(TMember input) {
final NameAndAccess[] nameAndAccess = NameAndAccess.of(input);
if (nameAndAccess.length > 1) {
setAdditionalElement(new AbstractMap.SimpleImmutableEntry<>(nameAndAccess[1], input));
}
return new AbstractMap.SimpleImmutableEntry<>(nameAndAccess[0], input);
}
});
}
@Override
public int size() {
return members.size();
}
};
}
示例2: iterator
import com.google.common.collect.Iterators; //导入方法依赖的package包/类
@Override
public Iterator<FragmentExecutor> iterator() {
return Iterators.unmodifiableIterator(
FluentIterable
.from(handlers.asMap().values())
.transform(new Function<FragmentHandler, FragmentExecutor>() {
@Nullable
@Override
public FragmentExecutor apply(FragmentHandler input) {
return input.getExecutor();
}
})
.filter(Predicates.<FragmentExecutor>notNull())
.iterator()
);
}
示例3: getFolderIterator
import com.google.common.collect.Iterators; //导入方法依赖的package包/类
@Override
public UnmodifiableIterator<URI> getFolderIterator(URI folderLocation) {
final IContainer container;
if (DIRECT_RESOURCE_IN_PROJECT_SEGMENTCOUNT == folderLocation.segmentCount()) {
container = workspace.getProject(folderLocation.lastSegment());
} else {
container = workspace.getFolder(new Path(folderLocation.toPlatformString(true)));
}
if (container != null && container.exists()) {
final List<URI> result = Lists.newLinkedList();
try {
container.accept(new IResourceVisitor() {
@Override
public boolean visit(IResource resource) throws CoreException {
if (resource.getType() == IResource.FILE) {
result.add(URI.createPlatformResourceURI(resource.getFullPath().toString(), true));
}
return true;
}
});
return Iterators.unmodifiableIterator(result.iterator());
} catch (CoreException e) {
return Iterators.unmodifiableIterator(result.iterator());
}
}
return Iterators.emptyIterator();
}
示例4: getWorkIterable
import com.google.common.collect.Iterators; //导入方法依赖的package包/类
@JsonIgnore
public Iterable<CompleteFileWork> getWorkIterable() {
return new Iterable<CompleteFileWork>() {
@Override
public Iterator<CompleteFileWork> iterator() {
return Iterators.unmodifiableIterator(chunks.iterator());
}
};
}
示例5: getWorkIterable
import com.google.common.collect.Iterators; //导入方法依赖的package包/类
public Iterable<CompleteFileWork> getWorkIterable() {
return new Iterable<CompleteFileWork>() {
@Override
public Iterator<CompleteFileWork> iterator() {
return Iterators.unmodifiableIterator(chunks.iterator());
}
};
}
示例6: iterator
import com.google.common.collect.Iterators; //导入方法依赖的package包/类
public Iterator<T> iterator()
{
return Iterators.unmodifiableIterator(references.keySet().iterator());
}
示例7: iterator
import com.google.common.collect.Iterators; //导入方法依赖的package包/类
public Iterator<T> iterator()
{
return this.field_181745_e.isEmpty() ? Iterators.<T>emptyIterator() : Iterators.unmodifiableIterator(this.field_181745_e.iterator());
}
示例8: iterator
import com.google.common.collect.Iterators; //导入方法依赖的package包/类
/** Returns an (unmodifiable) iterator over the entries currently on the workbench.
*
* @return an (unmodifiable) iterator over the entries currently on the workbench.
*/
@Override
public Iterator<WorkbenchEntry> iterator() {
return Iterators.unmodifiableIterator(entries.iterator());
}
示例9: iterator
import com.google.common.collect.Iterators; //导入方法依赖的package包/类
@Override
public Iterator<I> iterator() {
return Iterators.unmodifiableIterator(items.iterator());
}
示例10: iterator
import com.google.common.collect.Iterators; //导入方法依赖的package包/类
@Override
public Iterator<RoutingNode> iterator() {
return Iterators.unmodifiableIterator(nodesToShards.values().iterator());
}
示例11: iterator
import com.google.common.collect.Iterators; //导入方法依赖的package包/类
@Override
public Iterator<ShardRouting> iterator() {
return Iterators.unmodifiableIterator(shards.iterator());
}
示例12: iterator
import com.google.common.collect.Iterators; //导入方法依赖的package包/类
@Override
public Iterator<Item> iterator() {
return Iterators.unmodifiableIterator(items.iterator());
}
示例13: iterator
import com.google.common.collect.Iterators; //导入方法依赖的package包/类
@Override
public Iterator<TermVectorsRequest> iterator() {
return Iterators.unmodifiableIterator(requests.iterator());
}
示例14: iterator
import com.google.common.collect.Iterators; //导入方法依赖的package包/类
@Override
public Iterator<E> iterator() {
return Iterators.unmodifiableIterator(deque.iterator());
}
示例15: descendingIterator
import com.google.common.collect.Iterators; //导入方法依赖的package包/类
@Override
public Iterator<E> descendingIterator() {
return Iterators.unmodifiableIterator(deque.descendingIterator());
}