edu.iris.Fissures.seed.builder
Class SeedExportBuilder

java.lang.Object
  extended by edu.iris.Fissures.seed.builder.ExportBuilder
      extended by edu.iris.Fissures.seed.builder.SeedExportBuilder

public class SeedExportBuilder
extends ExportBuilder

Concrete Builder class for exporting Blockette objects from the SeedObjectContainer to a SEED file format.

Version:
4/3/2008
Author:
Robert Casey, IRIS DMC

Nested Class Summary
 
Nested classes/interfaces inherited from class edu.iris.Fissures.seed.builder.ExportBuilder
ExportBuilder.LogicalRecord
 
Field Summary
 
Fields inherited from class edu.iris.Fissures.seed.builder.ExportBuilder
builderType, endOfGroup, endOfLogical, endOfPhysical, exportMold, exportScript, logicalPerPhysical, logicalRecord, logicalRecordCount, logicalRecordLength, logicalRecords, nestingDepth, nestingScore, outputStream, padEnabledFlag, penDown, physicalRecordLength, recordPadding, scriptCursor, scriptNesting, vaxOrder
 
Constructor Summary
SeedExportBuilder()
          Create new Seed Export Builder.
SeedExportBuilder(java.lang.String mode)
          Create the builder to output one of the SEED variants.
 
Method Summary
protected  boolean checkTrigger(java.lang.String s)
          Check for script triggers.
static Btime getEndTime(Btime startTime, int numSamples, int srFactor, int srMult)
          Get the end time (as a Btime object).
protected  void packToRecord()
          Pack currently held Blockette object to a SEED logical record.
 void setDatalessMode()
          Set the builder to datalessSEED output mode.
 void setDefaultMode()
          Set the builder to (default) full SEED mode.
protected  void setLogicalRecordLength()
          Sets the logical record length to the default value.
protected  void setLogicalRecordLength(Waveform waveFrm, int offset)
          Sets the logical record length.
 void setMiniMode()
          Set the builder to miniSEED output mode.
 void setOrganizationName(java.lang.String name)
          Set the originating organization name for this volume.
 void setVolumeLabel(java.lang.String label)
          Set the label string for this volume.
protected  void startNewLogical(SeedObject obj, boolean continuation)
          Start a new logical record.
protected  void volumeFinish()
          Finishing actions for exporting to SEED.
 
Methods inherited from class edu.iris.Fissures.seed.builder.ExportBuilder
build, close, finish, getNext, getType, isPaddingEnabled, open, padLogical, padPhysical, push, setLogicalRecLen, setPaddingEnabled, setPhysicalRecLen, setVaxOrder, startVolume, writeRecord
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SeedExportBuilder

public SeedExportBuilder()
Create new Seed Export Builder. Set the builder to run in default (full SEED) mode.


SeedExportBuilder

public SeedExportBuilder(java.lang.String mode)
Create the builder to output one of the SEED variants. The current variants are: full, mini, dataless.. Default case is full.

Method Detail

setDatalessMode

public void setDatalessMode()
Set the builder to datalessSEED output mode.


setMiniMode

public void setMiniMode()
Set the builder to miniSEED output mode.


setDefaultMode

public void setDefaultMode()
Set the builder to (default) full SEED mode.


setOrganizationName

public void setOrganizationName(java.lang.String name)
                         throws SeedFormatException
Set the originating organization name for this volume. The originating organization is the institution authoring this volume. Max length of 80 characters.

Throws:
SeedFormatException

setVolumeLabel

public void setVolumeLabel(java.lang.String label)
                    throws SeedFormatException
Set the label string for this volume. Max length of 80 characters.

Throws:
SeedFormatException

getEndTime

public static Btime getEndTime(Btime startTime,
                               int numSamples,
                               int srFactor,
                               int srMult)
                        throws java.lang.Exception
Get the end time (as a Btime object). Projected from the start time based on the number of samples and the calculated sample rate.

Throws:
java.lang.Exception

setLogicalRecordLength

protected void setLogicalRecordLength()
Sets the logical record length to the default value.


setLogicalRecordLength

protected void setLogicalRecordLength(Waveform waveFrm,
                                      int offset)
Sets the logical record length.

Parameters:
waveFrm - the Waveform or null if none.
offset - the offset.

packToRecord

protected void packToRecord()
                     throws java.lang.Exception
Pack currently held Blockette object to a SEED logical record.

Specified by:
packToRecord in class ExportBuilder
Throws:
java.lang.Exception

checkTrigger

protected boolean checkTrigger(java.lang.String s)
                        throws java.lang.Exception
Check for script triggers. Implement export script triggers here.

Specified by:
checkTrigger in class ExportBuilder
Throws:
java.lang.Exception

volumeFinish

protected void volumeFinish()
                     throws BuilderException
Finishing actions for exporting to SEED. Nothing currently performed here.

Specified by:
volumeFinish in class ExportBuilder
Throws:
BuilderException

startNewLogical

protected void startNewLogical(SeedObject obj,
                               boolean continuation)
                        throws java.lang.Exception
Start a new logical record. Preface record with sequence number and record type/quality code. The SeedObject parameter is one that defines the type of record this is. The continuation boolean triggers the marking of the record as a continuation record.

Specified by:
startNewLogical in class ExportBuilder
Throws:
java.lang.Exception