Java Collections.emptyIterator Examples

Java Collections.emptyIterator - 29 examples found. These are the top rated real world Java examples of java.util.Collections.emptyIterator extracted from open source projects. You can rate examples to help us improve the quality of examples.
  @Override
  public CloseableIterator<GeoWaveData<GridCoverage>> toGeoWaveData(
      final File input,
      final Collection<ByteArrayId> primaryIndexIds,
      final String globalVisibility) {

    final AbstractGridFormat format = GridFormatFinder.findFormat(input);
    final GridCoverage2DReader reader = format.getReader(input);
    if (reader == null) {
      LOGGER.error("Unable to get reader instance, getReader returned null");
      return new Wrapper(Collections.emptyIterator());
    }
    try {
      final GridCoverage2D coverage = reader.read(null);
      if (coverage != null) {
        final Map<String, String> metadata = new HashMap<String, String>();
        final String coverageName = coverage.getName().toString();
        final String[] mdNames = reader.getMetadataNames(coverageName);
        if ((mdNames != null) && (mdNames.length > 0)) {
          for (final String mdName : mdNames) {
            metadata.put(mdName, reader.getMetadataValue(coverageName, mdName));
          }
        }
        final RasterDataAdapter adapter =
            new RasterDataAdapter(
                input.getName(),
                metadata,
                coverage,
                optionProvider.getTileSize(),
                optionProvider.isBuildPyramid());
        final List<GeoWaveData<GridCoverage>> coverages =
            new ArrayList<GeoWaveData<GridCoverage>>();
        coverages.add(new GeoWaveData<GridCoverage>(adapter, primaryIndexIds, coverage));
        return new Wrapper(coverages.iterator()) {

          @Override
          public void close() throws IOException {
            reader.dispose();
          }
        };
      } else {
        LOGGER.warn(
            "Null grid coverage from file '"
                + input.getAbsolutePath()
                + "' for discovered geotools format '"
                + format.getName()
                + "'");
      }
    } catch (final IOException e) {
      LOGGER.warn(
          "Unable to read grid coverage of file '"
              + input.getAbsolutePath()
              + "' for discovered geotools format '"
              + format.getName()
              + "'",
          e);
    }
    return new Wrapper(Collections.emptyIterator());
  }
 private void setup() {
   bKeys = _predicate.streamB.getIndex().keySet().iterator();
   currA = null;
   currB = null;
   aSeed = null;
   aInstances = Collections.emptyIterator();
   bInstances = Collections.emptyIterator();
 }
Example #3
0
 @Override
 public Iterator<GetField> iterator() {
   if (fields == null) {
     return Collections.emptyIterator();
   }
   return fields.values().iterator();
 }
 private <T> Iterator<T> getIterator(int type) {
   if (count == 0) {
     return Collections.emptyIterator();
   } else {
     return new Enumerator<>(type, true);
   }
 }
 @Override
 public Iterator<T> iterator() {
   if (this.internalList != null) {
     return this.internalList.iterator();
   }
   return Collections.emptyIterator();
 }
Example #6
0
 @Override
 public Iterator<Variable<?>> iterator() {
   if (variables.isEmpty()) {
     return Collections.emptyIterator();
   }
   return variables.iterator();
 }