public class TestOptions extends Object
The intent of this class is to provide a uniform treatment of command-line arguments. It also provides a way of discovering command-line arguments that are not recognized by the application. This situation sometimes occurs when the operator makes a typographical error in the specification of arguments.
| Modifier and Type | Class and Description |
|---|---|
static class |
TestOptions.GeoCoordinateOption
An enumeration giving options for how an input LAS file
with a geographic coordinate system is to be treated.
|
| Modifier and Type | Field and Description |
|---|---|
static String[] |
BUILT_IN_OPTIONS
The options that are recognized and processed by the
this class.
|
| Constructor and Description |
|---|
TestOptions() |
| Modifier and Type | Method and Description |
|---|---|
boolean[] |
argumentScan(String[] args)
Scan the argument list, extracting standard arguments.
|
void |
checkForMandatoryOptions(String[] args,
String[] options) |
void |
checkForUnrecognizedArgument(String[] args,
boolean[] matched)
Performs a check for any arguments that were not matched.
|
double[] |
getClipBounds()
Get the clip bounds specified as a sequence of 4 floating-point values
giving minX, maxX, minY, maxY.
|
int |
getColumnCount(int defaultCount)
Gets the number of columns to be used in applications which process a
grid of data values.
|
File |
getConstraintsFile()
Gets the constraints file (if specified).
|
char |
getDelimiter()
Gets the delimiter character specified in the options.
|
String |
getFileExtension(File file)
Gets the extension from the specified file
|
double[] |
getFrame()
Get the frame specified as a sequence of 4 floating-point values
giving minX, maxX, minY, maxY.
|
TestOptions.GeoCoordinateOption |
getGeoCoordinateOption()
Gets the geographic coordinate conversion option, if specified.
|
File |
getInputFile()
Gets the input file.
|
String |
getInputFileRootString()
Gets the root string for the input file, removing the file-type suffix
from the end of the string.
|
InterpolationMethod |
getInterpolationMethod()
Gets the interpolation method based on the specified options,
default value is NaturalNeighbor;
|
org.tinfour.interpolation.IInterpolatorOverTin |
getInterpolator(org.tinfour.common.IIncrementalTin tin)
Constructs an interpolator based on the specified options,
default value is NaturalNeighbor.
|
int |
getLidarClass()
Gets the target lidar classification for samples to be read from an LAS
file.
|
double |
getLidarThinningFactor()
Gets a lidar thinning factor used for selecting random subsets of lidar
samples from an LAS file.
|
long |
getMaxVertices(long defaultMax)
Gets a limit for the number of vertices that are read from a LAS file,
intended for use in situations where available memory is limited.
|
org.tinfour.common.IIncrementalTin |
getNewInstanceOfTestTin()
Gets a new instance of the class specified via the command-line options
by invoking its default constructor.
|
File |
getOutputFile()
Gets the output file.
|
TestPalette |
getPalette()
Get an instance of a palette for rendering.
|
long |
getRandomSeed(long defaultSeed)
Gets a value for a seed to be used for producing a sequence of values
using a random-number generator.
|
int |
getRowCount(int defaultCount)
Gets the number of rows to be used in applications which process a grid
of data values.
|
int |
getTestCount(int defaultCount)
Gets the number of tests to be performed by applications which feature
repeated tests.
|
Class<?> |
getTinClass()
Gets the class specified for the test (default: IncrementalTin)
|
int |
getVertexCount(int defaultCount)
Gets the number of points to be used in applications which process a
randomly generated list of vertices.
|
boolean |
isClipSet()
Indicates whether the clip bounds was specified.
|
boolean |
isFrameSet()
Indicates whether the frame was specified.
|
boolean |
isPaletteSet()
Indicates whether a palette was specified
|
boolean |
isPreAllocateEnabled(boolean defaultEnabled)
Indicates whether edge pre-allocation is enabled.
|
boolean |
isPreSortEnabled(boolean defaultEnabled)
Indicates whether the vertex list should be Hilbert sorted before
insertion into the TIN.
|
boolean |
isTinClassSet()
Indicates whether the options specified a class for the Incremental TIN.
|
Boolean |
scanBooleanOption(String[] args,
String option,
boolean[] matched,
Boolean defaultValue)
Scans the argument array to see if it included the specification of a
boolean option in the form "-Option" or "-noOption".
|
double[] |
scanBounds(String[] args,
String option,
boolean[] matched)
Scan for an option giving ranges for a rectangular region in the
order minX, maxX, minY, maxY.
|
Double |
scanDoubleOption(String[] args,
String option,
boolean[] matched)
Search the arguments for the specified option followed by a
floating-point value, marking the matched array if it is found.
|
Integer |
scanIntOption(String[] args,
String option,
boolean[] matched,
Integer defaultValue)
Search the arguments for the specified option followed by a integer
value, marking the matched array if it is found.
|
Long |
scanLongOption(String[] args,
String option,
boolean[] matched)
Search the arguments for the specified option followed by a long integer
value, marking the matched array if it is found.
|
String |
scanStringOption(String[] args,
String option,
boolean[] matched)
Search the arguments for the specified option followed by a string,
marking the matched array if it is found.
|
void |
setLidarClass(int classification)
Set the default classification for lidar points to be accepted when
reading a LAS file.
|
public static final String[] BUILT_IN_OPTIONS
public Integer scanIntOption(String[] args, String option, boolean[] matched, Integer defaultValue) throws IllegalArgumentException
args - a valid array of arguments.option - the target command-line argument (introduced by a dash)matched - an array parallel to args used to indicate which arguments
were identified by the scan operation.defaultValue - a default value to be returned if the option is
not found, or a null if none is supplied.IllegalArgumentExceptionpublic Long scanLongOption(String[] args, String option, boolean[] matched) throws IllegalArgumentException
args - a valid array of arguments.option - the target command-line argument (introduced by a dash)matched - an array parallel to args used to indicate which arguments
were identified by the scan operation.IllegalArgumentExceptionpublic Double scanDoubleOption(String[] args, String option, boolean[] matched) throws IllegalArgumentException
args - a valid array of arguments.option - the target command-line argument (introduced by a dash)matched - an array parallel to args used to indicate which arguments
were identified by the scan operation.IllegalArgumentExceptionpublic Boolean scanBooleanOption(String[] args, String option, boolean[] matched, Boolean defaultValue)
args - a valid array of command-line argumentsoption - the target optionmatched - an array paralleling args to indicate whether the args
matched a search option.defaultValue - a default value to be returned if the option is
not found, or a null if none is supplied.public String scanStringOption(String[] args, String option, boolean[] matched) throws IllegalArgumentException
args - a valid array of arguments.option - the target command-line argument (introduced by a dash)matched - an array parallel to args used to indicate which arguments
were identified by the scan operation.IllegalArgumentExceptionpublic double[] scanBounds(String[] args, String option, boolean[] matched)
args - a valid array of arguments.option - the target command-line argument (introduced by a dash)matched - an array parallel to args used to indicate which arguments
were identified by the scan operation.public String getFileExtension(File file)
file - a valid file referencepublic boolean[] argumentScan(String[] args)
args - a valid, potentially zero-length argument list.public File getInputFile()
public File getOutputFile()
public String getInputFileRootString()
public int getRowCount(int defaultCount)
defaultCount - the default number of rows; supply an impossible
value if no default is available.public int getColumnCount(int defaultCount)
defaultCount - the default number of columns; supply an impossible
value if no default is available.public int getVertexCount(int defaultCount)
defaultCount - the default number of vertices; supply an impossible
value if no default is available.public int getTestCount(int defaultCount)
defaultCount - the default number of tests; supply an impossible
value if no default is available.public long getMaxVertices(long defaultMax)
defaultMax - the default maximum value, use Long.MAX_VALUE if there
is no limit.public long getRandomSeed(long defaultSeed)
defaultSeed - a default value .public boolean isPreSortEnabled(boolean defaultEnabled)
defaultEnabled - a default value supplied by the applicatpublic boolean isPreAllocateEnabled(boolean defaultEnabled)
defaultEnabled - a default value supplied by the applicationpublic void checkForUnrecognizedArgument(String[] args, boolean[] matched)
args - a valid array of argumentsmatched - a parallel array to args, used to track which arguments
were matched to supported options.public int getLidarClass()
public void setLidarClass(int classification)
classification - an integer in the range 0 to 255, or -1 for all.public double getLidarThinningFactor()
public double[] getClipBounds()
public boolean isClipSet()
public boolean isFrameSet()
public double[] getFrame()
public boolean isTinClassSet()
public Class<?> getTinClass()
public org.tinfour.common.IIncrementalTin getNewInstanceOfTestTin()
public boolean isPaletteSet()
public TestPalette getPalette()
public TestOptions.GeoCoordinateOption getGeoCoordinateOption()
public char getDelimiter()
public org.tinfour.interpolation.IInterpolatorOverTin getInterpolator(org.tinfour.common.IIncrementalTin tin)
tin - a valid instance of an IIncrementalTin implementation.public InterpolationMethod getInterpolationMethod()
public File getConstraintsFile()
Copyright © 2019. All rights reserved.