Java Code Examples for com.google.common.collect.Iterators#unmodifiableIterator()

The following examples show how to use com.google.common.collect.Iterators#unmodifiableIterator() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PlatformResourceURI.java    From n4js with Eclipse Public License 1.0 6 votes vote down vote up
@Override
public Iterator<PlatformResourceURI> getAllChildren() {
	IResource container = getCachedResource();
	if (container instanceof IContainer) {
		final List<PlatformResourceURI> result = Lists.newArrayList();
		try {
			container.accept(new IResourceVisitor() {
				@Override
				public boolean visit(IResource resource) throws CoreException {
					if (resource.getType() == IResource.FILE)
						result.add(new PlatformResourceURI(resource));
					// do not iterate over contents of nested node_modules folders
					if (resource.getType() == IResource.FOLDER
							&& resource.getName().equals(N4JSGlobals.NODE_MODULES)) {
						return false;
					}
					return true;
				}
			});
			return Iterators.unmodifiableIterator(result.iterator());
		} catch (CoreException e) {
			return Iterators.unmodifiableIterator(result.iterator());
		}
	}
	return Iterators.unmodifiableIterator(Collections.emptyIterator());
}
 
Example 2
Source File: MapBasedBsonDocument.java    From mongowp with Apache License 2.0 5 votes vote down vote up
@Override
public UnmodifiableIterator<Entry<?>> iterator() {
  return Iterators.unmodifiableIterator(
      Iterators.transform(
          map.entrySet().iterator(),
          AbstractBsonDocument.FromEntryMap.INSTANCE
      )
  );
}
 
Example 3
Source File: RoutingNode.java    From Elasticsearch with Apache License 2.0 4 votes vote down vote up
@Override
public Iterator<ShardRouting> iterator() {
    return Iterators.unmodifiableIterator(shards.iterator());
}
 
Example 4
Source File: SingleValueBsonArray.java    From mongowp with Apache License 2.0 4 votes vote down vote up
@Override
public UnmodifiableIterator<BsonValue<?>> iterator() {
  return Iterators.unmodifiableIterator(Collections.<BsonValue<?>>singleton(child).iterator());
}
 
Example 5
Source File: Schema.java    From search-commons with Apache License 2.0 4 votes vote down vote up
/**
 * {@link Iterator#remove()}操纵不支持
 */
@Override
public Iterator<Table> iterator() {
    return Iterators.unmodifiableIterator(tableMap.values().iterator());
}
 
Example 6
Source File: UnmodifiableCollection.java    From yangtools with Eclipse Public License 1.0 4 votes vote down vote up
@Override
public @NonNull Iterator<E> iterator() {
    return Iterators.unmodifiableIterator(delegate.iterator());
}
 
Example 7
Source File: CollectionWrappers.java    From yangtools with Eclipse Public License 1.0 4 votes vote down vote up
@Override
public Iterator<E> iterator() {
    return Iterators.unmodifiableIterator(delegate.iterator());
}
 
Example 8
Source File: Refs.java    From stratio-cassandra with Apache License 2.0 4 votes vote down vote up
public Iterator<T> iterator()
{
    return Iterators.unmodifiableIterator(references.keySet().iterator());
}
 
Example 9
Source File: VertexArrayList.java    From grakn with GNU Affero General Public License v3.0 4 votes vote down vote up
@Override
public Iterator<JanusGraphVertex> iterator() {
    return Iterators.unmodifiableIterator(vertices.iterator());
}
 
Example 10
Source File: MultiTermVectorsRequest.java    From Elasticsearch with Apache License 2.0 4 votes vote down vote up
@Override
public Iterator<TermVectorsRequest> iterator() {
    return Iterators.unmodifiableIterator(requests.iterator());
}
 
Example 11
Source File: MultiGetRequest.java    From Elasticsearch with Apache License 2.0 4 votes vote down vote up
@Override
public Iterator<Item> iterator() {
    return Iterators.unmodifiableIterator(items.iterator());
}
 
Example 12
Source File: ListBasedBsonDocument.java    From mongowp with Apache License 2.0 4 votes vote down vote up
@Override
public UnmodifiableIterator<Entry<?>> iterator() {
  return Iterators.unmodifiableIterator(entries.iterator());
}
 
Example 13
Source File: RoutingNodes.java    From Elasticsearch with Apache License 2.0 4 votes vote down vote up
@Override
public Iterator<RoutingNode> iterator() {
    return Iterators.unmodifiableIterator(nodesToShards.values().iterator());
}
 
Example 14
Source File: UriSpec.java    From curator with Apache License 2.0 4 votes vote down vote up
@Override
public Iterator<Part> iterator()
{
    return Iterators.unmodifiableIterator(parts.iterator());
}
 
Example 15
Source File: EventListenerPipeline.java    From luna with MIT License 4 votes vote down vote up
@Override
public UnmodifiableIterator<EventListener<E>> iterator() {
    return Iterators.unmodifiableIterator(listeners.iterator());
}
 
Example 16
Source File: AreaManager.java    From luna with MIT License 4 votes vote down vote up
@Override
public UnmodifiableIterator<Area> iterator() {
    return Iterators.unmodifiableIterator(registeredAreas.iterator());
}
 
Example 17
Source File: ListBsonArray.java    From mongowp with Apache License 2.0 4 votes vote down vote up
@Override
public UnmodifiableIterator<BsonValue<?>> iterator() {
  return Iterators.unmodifiableIterator(list.listIterator());
}
 
Example 18
Source File: MixinMultiMap.java    From Hyperium with GNU Lesser General Public License v3.0 4 votes vote down vote up
/**
 * @author FalseHonesty
 * @reason ChatTriggers
 */
@Overwrite
public Iterator<T> iterator() {
    return values.isEmpty() ? (UnmodifiableListIterator<T>) Utils.EMPTY_ITERATOR : Iterators.unmodifiableIterator(values.iterator());
}
 
Example 19
Source File: ListValueStack.java    From grappa with Apache License 2.0 4 votes vote down vote up
@Override
public Iterator<V> iterator()
{
    return Iterators.unmodifiableIterator(stack.iterator());
}
 
Example 20
Source File: StoreViewModel.java    From arcusplatform with Apache License 2.0 4 votes vote down vote up
public Iterator<M> iterator() {
   return Iterators.unmodifiableIterator(delegate.iterator());
}