ucar.nc2.iosp
Class IndexChunker.Chunk

java.lang.Object
  extended by ucar.nc2.iosp.IndexChunker.Chunk
All Implemented Interfaces:
Layout.Chunk
Enclosing class:
IndexChunker

public static class IndexChunker.Chunk
extends Object
implements Layout.Chunk

A chunk of data that is contiguous in both the source and destination. Everything is done in elements, not bytes. Read nelems from src at srcPos, store in destination at destPos.


Constructor Summary
IndexChunker.Chunk(long srcElem, int nelems, long destElem)
           
 
Method Summary
 long getDestElem()
          Get the position in destination where to read or write
 int getNelems()
          Get number of elements to transfer contiguously (Note: elements, not bytes)
 long getSrcElem()
          Get the position in source where to read or write
 long getSrcPos()
          Get the position in source where to read or write: "file position"
 void incrDestElem(int incr)
           
 void incrSrcElem(int incr)
           
 void incrSrcPos(int incr)
           
 void setDestElem(long destElem)
           
 void setNelems(int nelems)
           
 void setSrcElem(long srcElem)
           
 void setSrcPos(long srcPos)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IndexChunker.Chunk

public IndexChunker.Chunk(long srcElem,
                          int nelems,
                          long destElem)
Method Detail

getSrcElem

public long getSrcElem()
Get the position in source where to read or write

Returns:
position as an element count

setSrcElem

public void setSrcElem(long srcElem)

incrSrcElem

public void incrSrcElem(int incr)

getNelems

public int getNelems()
Description copied from interface: Layout.Chunk
Get number of elements to transfer contiguously (Note: elements, not bytes)

Specified by:
getNelems in interface Layout.Chunk
Returns:
number of elements to transfer contiguously (Note: elements, not bytes)

setNelems

public void setNelems(int nelems)

getDestElem

public long getDestElem()
Get the position in destination where to read or write

Specified by:
getDestElem in interface Layout.Chunk
Returns:
starting element in the array: "starting array element" (Note: elements, not bytes)

setDestElem

public void setDestElem(long destElem)

incrDestElem

public void incrDestElem(int incr)

toString

public String toString()
Overrides:
toString in class Object

getSrcPos

public long getSrcPos()
Description copied from interface: Layout.Chunk
Get the position in source where to read or write: "file position"

Specified by:
getSrcPos in interface Layout.Chunk
Returns:
position as a byte count into the source, eg a file

setSrcPos

public void setSrcPos(long srcPos)

incrSrcPos

public void incrSrcPos(int incr)


Copyright © 1999-2011 UCAR/Unidata. All Rights Reserved.