org.opensha.refFaultParamDb.gui.view
Class AbstractSectionInfoFileWriter

java.lang.Object
  extended by org.opensha.refFaultParamDb.gui.view.AbstractSectionInfoFileWriter
All Implemented Interfaces:
java.lang.Runnable
Direct Known Subclasses:
SectionInfoCSVFileWriter, SectionInfoTextFileWriter

public abstract class AbstractSectionInfoFileWriter
extends java.lang.Object
implements java.lang.Runnable

Author:
vipingupta

Constructor Summary
AbstractSectionInfoFileWriter(DB_AccessAPI dbConnection)
           
 
Method Summary
abstract  java.lang.String getFaultAsString(FaultSectionPrefData faultSectionPrefData)
          Get String for representation for faultSectionPrefData
abstract  java.lang.String getFileHeader()
          File format for writing fault sections in a fault model file.
protected  java.lang.String getValue(double val)
           
protected  java.lang.String getValue(java.lang.String val)
           
 void run()
           
 void writeForFaultModel(FaultSectionPrefData faultSectionPrefData, java.io.FileWriter fw)
          Write FaultSectionPrefData to the file.
 void writeForFaultModel(int[] faultSectionIds, java.io.File file)
          Write FaultSectionPrefData to file.
 void writeForFaultModel(int faultSectionId, java.io.FileWriter fw)
          Write FaultSectionPrefData to the file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractSectionInfoFileWriter

public AbstractSectionInfoFileWriter(DB_AccessAPI dbConnection)
Method Detail

writeForFaultModel

public void writeForFaultModel(int[] faultSectionIds,
                               java.io.File file)
Write FaultSectionPrefData to file.

Parameters:
faultSectionIds - array of faultsection Ids
file -

run

public void run()
Specified by:
run in interface java.lang.Runnable

writeForFaultModel

public void writeForFaultModel(int faultSectionId,
                               java.io.FileWriter fw)
                        throws java.io.IOException
Write FaultSectionPrefData to the file. It does not contain slip rate and aseismic slip factor

Parameters:
faultSectionId - Fault section Id for which data needs to be written to file
fw -
Throws:
java.io.IOException

writeForFaultModel

public void writeForFaultModel(FaultSectionPrefData faultSectionPrefData,
                               java.io.FileWriter fw)
                        throws java.io.IOException
Write FaultSectionPrefData to the file. It does not contain slip rate and aseismic slip factor

Parameters:
faultSectionPrefData -
fw -
Throws:
java.io.IOException

getValue

protected java.lang.String getValue(double val)

getValue

protected java.lang.String getValue(java.lang.String val)

getFaultAsString

public abstract java.lang.String getFaultAsString(FaultSectionPrefData faultSectionPrefData)
Get String for representation for faultSectionPrefData

Parameters:
faultSectionPrefData -
Returns:

getFileHeader

public abstract java.lang.String getFileHeader()
File format for writing fault sections in a fault model file. Fault sections within a fault model do not have slip rate and aseismic slip factor

Returns: