org.tridas.io.formats.tucson
Class TucsonReader

java.lang.Object
  extended by org.tridas.io.AbstractDendroFileReader
      extended by org.tridas.io.formats.tucson.TucsonReader

public class TucsonReader
extends AbstractDendroFileReader

Reader for the Tucson file format.

Author:
peterbrewer

Constructor Summary
TucsonReader()
           
 
Method Summary
 void checkValidFile(String[] argFileString)
          This checks to see if the file is a valid Tucson file and at the same time sets whether its an RWL or CRN style file.
 int getCurrentLineNumber()
          Gets the current line number of the reader.
 IMetadataFieldSet getDefaults()
          Get the default values for this reader that were given in loading the file.
 DendroFileFilter getDendroFileFilter()
           
 String getDescription()
          Get the description of the format
 String[] getFileExtensions()
          Returns a list of the file extensions for this file
 String getFullName()
          Get the full name of the format
protected  org.tridas.io.formats.tucson.TucsonReader.TucsonLineType getLineType(String line)
          Attempt to determine the type of line this is through regexes.
 org.tridas.schema.TridasProject[] getProjects()
          Gets the parsed projects after they are loaded.
 String getShortName()
          Get the short name of the format
 org.tridas.schema.TridasTridas getTridasContainer()
           
protected  void loadMetadata(org.tridas.io.formats.tucson.TucsonReader.TucsonSeries series, String line1, String line2, String line3)
          Attempts to load metadata from a three line header
protected  void parseFile(String[] argFileString, IMetadataFieldSet argDefaultFields)
          Parse the file from the given metadata and strings
protected  void resetReader()
          Reset the reader
 
Methods inherited from class org.tridas.io.AbstractDendroFileReader
addWarning, clearWarnings, constructDefaultMetadata, getDefaultFieldsClass, getOriginalFilename, getWarnings, loadFile, loadFile, loadFile, loadFile, loadFile, loadFile, reset, setOriginalFilename
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TucsonReader

public TucsonReader()
Method Detail

getCurrentLineNumber

public int getCurrentLineNumber()
Description copied from class: AbstractDendroFileReader
Gets the current line number of the reader. If errors occurred, this could help point towards the cause.

Specified by:
getCurrentLineNumber in class AbstractDendroFileReader
Returns:
the current line number
See Also:
AbstractDendroFileReader.getCurrentLineNumber()

getDefaults

public IMetadataFieldSet getDefaults()
Description copied from class: AbstractDendroFileReader
Get the default values for this reader that were given in loading the file. If the loadFile method was never called, then this returns null.

Specified by:
getDefaults in class AbstractDendroFileReader
Returns:
See Also:
AbstractDendroFileReader.getDefaults()

getDescription

public String getDescription()
Description copied from class: AbstractDendroFileReader
Get the description of the format

Specified by:
getDescription in class AbstractDendroFileReader
Returns:
See Also:
org.tridas.io.IDendroFileReader#getDescription()

getFullName

public String getFullName()
Description copied from class: AbstractDendroFileReader
Get the full name of the format

Specified by:
getFullName in class AbstractDendroFileReader
Returns:
See Also:
org.tridas.io.IDendroFileReader#getFullName()

getShortName

public String getShortName()
Description copied from class: AbstractDendroFileReader
Get the short name of the format

Specified by:
getShortName in class AbstractDendroFileReader
Returns:
See Also:
org.tridas.io.IDendroFileReader#getShortName()

resetReader

protected void resetReader()
Description copied from class: AbstractDendroFileReader
Reset the reader

Specified by:
resetReader in class AbstractDendroFileReader
See Also:
AbstractDendroFileReader.resetReader()

getFileExtensions

public String[] getFileExtensions()
Description copied from class: AbstractDendroFileReader
Returns a list of the file extensions for this file

Specified by:
getFileExtensions in class AbstractDendroFileReader
Returns:
See Also:
AbstractDendroFileReader.getFileExtensions()

parseFile

protected void parseFile(String[] argFileString,
                         IMetadataFieldSet argDefaultFields)
                  throws InvalidDendroFileException
Description copied from class: AbstractDendroFileReader
Parse the file from the given metadata and strings

Specified by:
parseFile in class AbstractDendroFileReader
Throws:
InvalidDendroFileException
See Also:
org.tridas.io.AbstractDendroFileReader#parseFile()

checkValidFile

public void checkValidFile(String[] argFileString)
                    throws InvalidDendroFileException
This checks to see if the file is a valid Tucson file and at the same time sets whether its an RWL or CRN style file.

Parameters:
argFileString -
Throws:
InvalidDendroFileException

loadMetadata

protected void loadMetadata(org.tridas.io.formats.tucson.TucsonReader.TucsonSeries series,
                            String line1,
                            String line2,
                            String line3)
Attempts to load metadata from a three line header

Parameters:
line1 -
line2 -
line3 -

getLineType

protected org.tridas.io.formats.tucson.TucsonReader.TucsonLineType getLineType(String line)
Attempt to determine the type of line this is through regexes. Note this is not perfect, especially for headers where there is little to distinguish them from random text

Parameters:
line -
Returns:

getDendroFileFilter

public DendroFileFilter getDendroFileFilter()
Specified by:
getDendroFileFilter in class AbstractDendroFileReader
See Also:
AbstractDendroFileReader.getDendroFileFilter()

getProjects

public org.tridas.schema.TridasProject[] getProjects()
Description copied from class: AbstractDendroFileReader
Gets the parsed projects after they are loaded.

Specified by:
getProjects in class AbstractDendroFileReader
See Also:
AbstractDendroFileReader.getProjects()

getTridasContainer

public org.tridas.schema.TridasTridas getTridasContainer()
Specified by:
getTridasContainer in class AbstractDendroFileReader
See Also:
AbstractDendroFileReader.getTridasContainer()


Copyright © 2011. All Rights Reserved.