org.javaseis.io
Class Seisio.TraceMap

java.lang.Object
  extended by org.javaseis.io.Seisio.TraceMap
Enclosing class:
Seisio

protected class Seisio.TraceMap
extends java.lang.Object

The TraceMap class provides mapping support for the JavaSeisFileIO class.


Field Summary
protected  int _framesPerVolume
           
protected  boolean _isChanged
           
protected  int[] _traceMapArray
           
protected  int _volumeIndex
           
 
Constructor Summary
Seisio.TraceMap(int framesPerVolume)
          Constructs an instance of TraceMap.
 
Method Summary
protected  void assertAllValuesInitialized()
          Asserts that all trace map values have been initialized (i.e.
protected  void checkVolumeIndex()
          Checks for valid volume index.
 int get(int frameIndex)
          Gets the trace map value at the specified frame index.
 int[] getTraceMapArray()
           
 boolean hasValue(int frameIndex)
          Checks for valid trace map value at the specified frame index.
 void intializeTraceMapOnDisk()
          Initialize the trace map on disk Sets all values in the map to zero
 void put(int frameIndex, int numTraces)
          Puts the trace map value at the specified frame index.
 void read(int volumeIndex)
          Reads the trace map from disk.
 void reInitialize()
          Re-initializes the trace map array.
 void setVolumeIndex(int volumeIndex)
          Sets the volume index, flushing to current map buffer.
 void writeFrame()
          Writes the trace map to disk for a single frame.
 void writeMap()
          Writes the trace map to disk for the current volume.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_framesPerVolume

protected int _framesPerVolume

_isChanged

protected boolean _isChanged

_traceMapArray

protected int[] _traceMapArray

_volumeIndex

protected int _volumeIndex
Constructor Detail

Seisio.TraceMap

public Seisio.TraceMap(int framesPerVolume)
Constructs an instance of TraceMap.

Parameters:
framesPerVolume - The number of frames per volume.
Method Detail

assertAllValuesInitialized

protected void assertAllValuesInitialized()
Asserts that all trace map values have been initialized (i.e. > 0). Used for testing.


checkVolumeIndex

protected void checkVolumeIndex()
Checks for valid volume index.


get

public int get(int frameIndex)
Gets the trace map value at the specified frame index.

Parameters:
frameIndex - The frame index to check.
Returns:
the trace map value (i.e. number of traces in the frame).

getTraceMapArray

public int[] getTraceMapArray()

hasValue

public boolean hasValue(int frameIndex)
Checks for valid trace map value at the specified frame index.

Parameters:
frameIndex - The frame index to check.
Returns:
true if valid value found; otherwise false.

intializeTraceMapOnDisk

public void intializeTraceMapOnDisk()
                             throws SeisException
Initialize the trace map on disk Sets all values in the map to zero

Throws:
SeisException

put

public void put(int frameIndex,
                int numTraces)
Puts the trace map value at the specified frame index.

Parameters:
frameIndex - The frame index to check.
numTraces - The trace map value (i.e. number of traces in the frame) to set.

read

public void read(int volumeIndex)
          throws SeisException
Reads the trace map from disk.

Parameters:
volumeIndex - The volume index of the trace map to read.
Throws:
SeisException - Thrown on read errors.

reInitialize

public void reInitialize()
Re-initializes the trace map array.


setVolumeIndex

public void setVolumeIndex(int volumeIndex)
                    throws SeisException
Sets the volume index, flushing to current map buffer.

Throws:
SeisException - Thrown on mapping errors.

writeFrame

public void writeFrame()
                throws SeisException
Writes the trace map to disk for a single frame.

Throws:
SeisException - Thrown on write errors.

writeMap

public void writeMap()
              throws SeisException
Writes the trace map to disk for the current volume.

Throws:
SeisException - Thrown on write errors.