ucar.nc2
Class Indexer

java.lang.Object
  extended by ucar.nc2.Indexer
Direct Known Subclasses:
RegularIndexer

public abstract class Indexer
extends java.lang.Object

Iterator to read/write subsets of an array.

Example for Integers:

    int[] pa = new int[size];
    Indexer index;
    while (index.hasNext()) {
        Indexer.Chunk chunk = index.next();
        raf.seek ( chunk.getFilePos());
        raf.readInt( pa, chunk.getIndexPos(), chunk.getNelems()); // copy into primitive array
      }

      IndexIterator ii = values.getIndexIterator();
      while (index.hasNext()) {
        Indexer.Chunk chunk = index.next(); // LOOK not using chunk.getIndexPos()
        raf.seek ( chunk.getFilePos());
        for (int k=0; k

Author:
caron

Nested Class Summary
 class Indexer.Chunk
          A contiguous chunk of data in the file, that is wanted for this subset.
 
Constructor Summary
Indexer()
           
 
Method Summary
abstract  int getElemSize()
           
abstract  int getTotalNelems()
           
abstract  boolean hasNext()
           
abstract  Indexer.Chunk next()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Indexer

public Indexer()
Method Detail

getTotalNelems

public abstract int getTotalNelems()
Returns:
total number of elements in the wanted subset.

getElemSize

public abstract int getElemSize()
Returns:
size of each element in bytes.

hasNext

public abstract boolean hasNext()
Returns:
true if theres more to do

next

public abstract Indexer.Chunk next()
Returns:
next chunk