edu.iris.Fissures.seed.director
Class SeedImportDirector

java.lang.Object
  extended by edu.iris.Fissures.seed.director.ImportDirector
      extended by edu.iris.Fissures.seed.director.SeedImportDirector

public class SeedImportDirector
extends ImportDirector

This class is the Director for reading SEED file streams into the SEED object pool. It reads in SEED records and contacts the SEED Builder to construct the appropriate blockette or data record construct.

Look to its abstract superclass, ImportDirector, to get details on generic methods run through this class.

Version:
7/5/2013
Author:
Robert Casey, IRIS DMC

Field Summary
protected  int bType
           
protected  int prevBType
           
protected  int prevStageNum
           
protected  int stageNum
           
 
Fields inherited from class edu.iris.Fissures.seed.director.ImportDirector
builder, fixedRecordLength, inStream, maxRecordLength, outputString, readBuffer, recCount, recLen, record, recordOffset, streamOpen
 
Constructor Summary
SeedImportDirector()
          Create a SEED import director.
SeedImportDirector(ObjectBuilder builder)
          Create a SEED import director and assign the indicated builder.
 
Method Summary
 int build()
          Construct a SEED Object from the import record.
 int getRecLen()
          Get the length of the next SEED record currently in the read buffer.
static void main(java.lang.String[] args)
          Test method.
 
Methods inherited from class edu.iris.Fissures.seed.director.ImportDirector
assignBuilder, close, construct, construct, getBuilder, open, read, read, setRecLen
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

bType

protected int bType

prevBType

protected int prevBType

stageNum

protected int stageNum

prevStageNum

protected int prevStageNum
Constructor Detail

SeedImportDirector

public SeedImportDirector()
Create a SEED import director.


SeedImportDirector

public SeedImportDirector(ObjectBuilder builder)
Create a SEED import director and assign the indicated builder.

Method Detail

getRecLen

public int getRecLen()
              throws java.lang.Exception
Get the length of the next SEED record currently in the read buffer.

Specified by:
getRecLen in class ImportDirector
Throws:
java.lang.Exception

build

public int build()
          throws java.lang.Exception
Construct a SEED Object from the import record. Order the assigned builder to construct an object from the current record array starting at the index indicated by instance variable 'recordOffset'. Return the number of bytes consumed in the build.

Specified by:
build in class ImportDirector
Throws:
java.lang.Exception

main

public static void main(java.lang.String[] args)
Test method. Accept a SEED filename to read as the first argument. Accept another filename for writing ASCII output as a second argument. To trigger object storage and retrieval in memory, there must be just one argument. To trigger printing of SEED info without object storage, provide the output file argument. To trigger object storage and retrieval using disk storage (serialization), make the output file parameter "object_store.ser". Four other parameters may be added that allow filtering to a specific station, channel, start time, and end time.