com.c5corp.DEMconvert.filters
Class SampleFilter

java.lang.Object
  extended by com.c5corp.DEMconvert.C5DemAbstractFilter
      extended by com.c5corp.DEMconvert.filters.SampleFilter
All Implemented Interfaces:
C5DemConstants

public final class SampleFilter
extends C5DemAbstractFilter

Sample C5demAbstractFilter

Since:
1.0
Author:
Brett Stalbaum Copyright 2002-2006 see LICENSE.txt and UCSD_LICENSE.txt

Field Summary
 
Fields inherited from interface com.c5corp.c5dem.C5DemConstants
copy, E_BIT, FEETTOMETERS, hdatum, METERSTOFEET, N_BIT, NE_BIT, NW_BIT, S_BIT, SE_BIT, SW_BIT, system, units, vdatum, W_BIT
 
Constructor Summary
SampleFilter()
          the default constructor creates a blank object such that writeHeader(Dem, PrintWriter) and writeData(Dem, Printwriter) can be used with arbitrary Dem and PrintWriter objects
SampleFilter(java.lang.String in_fileame)
          this constructor is used by the main method in this class, which is intended mostly for command line use.
 
Method Summary
 java.lang.String getFilterInfo()
          A method that returns a string containing information about the filter.
 java.lang.String getOutputPath()
          Returns a relative path describing the location of the output.
static void main(java.lang.String[] args)
          The main method is maintained so that this filter can be used from the command line, in addition to being used inside of c5 dem tool.
 java.lang.String toString()
          overrides java.lang.Object.toString()
 void writeData(Dem dem, java.io.PrintWriter out)
          A method to write the output (formated) data to the file.
 void writeHeader(Dem dem, java.io.PrintWriter out)
          A method for output of metadata to the file (overrides C5DemAbstractFilter), displaying many of the methods of the Dem class.
 
Methods inherited from class com.c5corp.DEMconvert.C5DemAbstractFilter
openOutputFile
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SampleFilter

public SampleFilter()
the default constructor creates a blank object such that writeHeader(Dem, PrintWriter) and writeData(Dem, Printwriter) can be used with arbitrary Dem and PrintWriter objects


SampleFilter

public SampleFilter(java.lang.String in_fileame)
this constructor is used by the main method in this class, which is intended mostly for command line use. This is optional - see comment for main.

Parameters:
in_fileame - the file name
Method Detail

main

public static void main(java.lang.String[] args)
The main method is maintained so that this filter can be used from the command line, in addition to being used inside of c5 dem tool. This is optional - C5 DEM Tools interface only requires the methods writeHeader and writeData, and getOutputPath below.

Parameters:
args - Usage: $ SampleFilter infile.dem [output dir]

writeHeader

public void writeHeader(Dem dem,
                        java.io.PrintWriter out)
A method for output of metadata to the file (overrides C5DemAbstractFilter), displaying many of the methods of the Dem class.

Specified by:
writeHeader in class C5DemAbstractFilter
Parameters:
dem - A Dem.
out - Where to write the data.

writeData

public void writeData(Dem dem,
                      java.io.PrintWriter out)
A method to write the output (formated) data to the file. (overrides C5DemAbstractFilter)

Specified by:
writeData in class C5DemAbstractFilter
Parameters:
dem - A Dem.
out - Where to write the data.

getFilterInfo

public java.lang.String getFilterInfo()
A method that returns a string containing information about the filter.

Specified by:
getFilterInfo in class C5DemAbstractFilter
Returns:
the string info about the filter

getOutputPath

public java.lang.String getOutputPath()
Returns a relative path describing the location of the output.

Overrides:
getOutputPath in class C5DemAbstractFilter
Returns:
the output file path

toString

public java.lang.String toString()
overrides java.lang.Object.toString()

Overrides:
toString in class C5DemAbstractFilter