Example usage for com.google.common.collect Iterators emptyIterator

List of usage examples for com.google.common.collect Iterators emptyIterator

Introduction

In this page you can find the example usage for com.google.common.collect Iterators emptyIterator.

Prototype

@Deprecated
public static <T> UnmodifiableIterator<T> emptyIterator() 

Source Link

Document

Returns the empty iterator.

Usage

From source file:gr.forth.ics.swkm.model2.index.NamespaceIndexer.java

Iterator<Resource> findInNamespace(RdfType type, Uri namespace) {
    //assuming type is only schema, and namespace does not have a local part
    //the relevant checks have moved to ModelImpl#findSchemaNodes
    Multimap<RdfType, Resource> map = index.get(namespace);
    if (map == null) {
        return Iterators.emptyIterator();
    }//from w ww .jav a 2s  .c o m
    return Iterators.unmodifiableIterator(map.get(type).iterator());
}

From source file:org.apache.cassandra.db.EmptyColumns.java

public Iterator<Column> iterator(ColumnSlice[] slices) {
    return Iterators.emptyIterator();
}

From source file:org.sonar.sslr.internal.ast.select.EmptyAstSelect.java

@Override
public Iterator<AstNode> iterator() {
    return Iterators.emptyIterator();
}

From source file:com.stottlerhenke.versionspaces.VSUnionIterator.java

/**
 * Constructor./*w  w w.j  a va2s  . c  om*/
 * 
 * @param vss The version spaces to union.
 */
public VSUnionIterator(final Iterable<VS<In, Out>> vss) {
    Iterator<ConfidentHypothesis<In, Out>> tmpItr = Iterators.emptyIterator();

    int totalConfidence = 0;

    for (VS<In, Out> vs : vss) {
        if (vs.iterator().hasNext()) {
            totalConfidence++;
        }
        tmpItr = Iterators.concat(tmpItr, vs.iterator());
    }

    // transform the compound iterator so that the confidences sum to 1.0
    _itr = Iterators.transform(tmpItr, new UnionFn(totalConfidence));
}

From source file:jp.xet.baseunits.time.spec.CalendarIntervalSpecification.java

@Override
public Iterator<CalendarDate> iterateOver(final CalendarInterval interval) {
    Interval<CalendarDate> i = this.interval.intersect(interval);
    if (i.isEmpty()) {
        return Iterators.emptyIterator();
    }/* w ww  .  j a  v  a  2s .  co m*/
    CalendarInterval intersect = CalendarInterval.inclusive(i.lowerLimit(), i.upperLimit());
    return intersect.daysIterator();
}

From source file:org.geoserver.catalog.util.CloseableIteratorAdapter.java

public static <T> CloseableIterator<T> empty() {
    Iterator<T> empty = Iterators.emptyIterator();
    return new CloseableIteratorAdapter<T>(empty);
}

From source file:org.apache.cassandra.db.EmptyColumns.java

public Iterator<Column> reverseIterator(ColumnSlice[] slices) {
    return Iterators.emptyIterator();
}

From source file:org.gradle.api.internal.file.CompositeFileCollection.java

@Override
public Iterator<File> iterator() {
    List<? extends FileCollectionInternal> sourceCollections = getSourceCollections();
    switch (sourceCollections.size()) {
    case 0:/*from   w  ww. j  ava2  s  . co m*/
        return Iterators.emptyIterator();
    case 1:
        return sourceCollections.get(0).iterator();
    default:
        // Need to make sure we remove duplicates, so we can't just compose iterators from source collections
        return getFiles(sourceCollections).iterator();
    }
}

From source file:org.eclipse.emf.cdo.compare.CDOComparisonScope.java

public Iterator<? extends Resource> getCoveredResources(ResourceSet resourceSet) {
    return Iterators.emptyIterator();
}

From source file:org.geogit.cli.porcelain.Diff.java

/**
 * Executes the diff command with the specified options.
 *///from  ww w . ja v a  2 s.  c  o  m
@Override
protected void runInternal(GeogitCLI cli) throws IOException {
    checkParameter(refSpec.size() <= 2, "Commit list is too long :%s", refSpec);
    checkParameter(!(nogeom && summary), "Only one printing mode allowed");

    GeoGIT geogit = cli.getGeogit();

    DiffOp diff = geogit.command(DiffOp.class);

    String oldVersion = resolveOldVersion();
    String newVersion = resolveNewVersion();

    diff.setOldVersion(oldVersion).setNewVersion(newVersion).setCompareIndex(cached);

    Iterator<DiffEntry> entries;
    if (paths.isEmpty()) {
        entries = diff.setProgressListener(cli.getProgressListener()).call();
    } else {
        entries = Iterators.emptyIterator();
        for (String path : paths) {
            Iterator<DiffEntry> moreEntries = diff.setFilter(path)
                    .setProgressListener(cli.getProgressListener()).call();
            entries = Iterators.concat(entries, moreEntries);
        }
    }

    if (!entries.hasNext()) {
        cli.getConsole().println("No differences found");
        return;
    }

    DiffPrinter printer;
    if (summary) {
        printer = new SummaryDiffPrinter();
    } else {
        printer = new FullDiffPrinter(nogeom, false);
    }

    DiffEntry entry;
    while (entries.hasNext()) {
        entry = entries.next();
        printer.print(geogit, cli.getConsole(), entry);
    }
}