public class PTF_Comparison
extends java.lang.Object
This class is not an implementation of the List
interface. This class includes a set of fields which
are ignored when specifying the discrepancies between the two files.
Modifier and Type | Class and Description |
---|---|
static class |
PTF_Comparison.Field_Pair
A pair of observation field values from two different sources.
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
COMPARISON_LIST |
static java.lang.String |
CSV_OUTPUT
The value for the display mode parameter that results in a comma-separated
value display.
|
static java.lang.String |
DEFAULT_OUTPUT_STYLE
The default display mode.
|
static java.lang.String |
DEFAULT_SOURCE_A |
static java.lang.String |
DEFAULT_SOURCE_B |
static java.lang.String |
ID
Class identification name with source code version and date.
|
static java.lang.String[] |
LIMIT_OUTPUT_OUTPUT_STYLES
The set of display modes not to print outside information.
|
static java.lang.String |
OUTPUT_STYLE
The parameter name for the configuration parameter controlling the list's
display mode.
|
static java.lang.String[] |
OUTPUT_STYLES
The set of display modes.
|
static java.lang.String |
PVL_OUTPUT
The value for the display mode parameter that results in a PVL parameter
display.
|
static java.lang.String |
SOURCE_A_NAME |
static java.lang.String |
SOURCE_B_NAME |
static java.lang.String |
TERSE_OUTPUT
The value for the display mode parameter that results in a terse,
informational display.
|
static java.lang.String |
VERBOSE_OUTPUT
The value for the display mode parameter that results in a verbose display.
|
Constructor and Description |
---|
PTF_Comparison()
Creates a new record list using default configuration values.
|
PTF_Comparison(PIRL.Configuration.Configuration configuration)
Creates a new record list using the indicated configuration.
|
Modifier and Type | Method and Description |
---|---|
void |
add(PTF_Comparison.Field_Pair pair)
Adds a new field pair.
|
void |
add(java.lang.String observation_id,
java.lang.String field_name,
java.lang.String value_a,
java.lang.String value_b) |
void |
configure(PIRL.Configuration.Configuration configuration)
Sets the list's configuration.
|
java.lang.String |
display()
Returns a text representation of the list.
|
java.lang.String |
display(java.lang.String output_style)
Returns a text representation of the list.
|
PTF_Comparison.Field_Pair |
get(int index)
Returns a field pair from the list at the indicated index.
|
static boolean |
is_valid_output_style(java.lang.String output_style)
Tests whether a given display mode is a valid one.
|
java.lang.String |
output_style()
Gets the display mode.
|
void |
output_style(java.lang.String output_style)
Sets the display mode.
|
PIRL.PVL.Parameter |
parameter()
Returns a PVL parameter representation of the list.
|
void |
remove(int index)
Removes the field pair from the list at the indicated index.
|
void |
set_ignored_fields(java.lang.String filename)
Builds the set of ignored fields.
|
int |
size()
Returns the number of entries in the list.
|
java.util.HashMap<java.lang.String,java.lang.String> |
source_a_bad() |
void |
source_a_bad(java.util.HashMap<java.lang.String,java.lang.String> source_a_bad) |
java.util.HashMap<java.lang.String,java.lang.String> |
source_b_bad() |
void |
source_b_bad(java.util.HashMap<java.lang.String,java.lang.String> source_b_bad) |
public static final java.lang.String ID
public static final java.lang.String OUTPUT_STYLE
public static final java.lang.String PVL_OUTPUT
OUTPUT_STYLE
,
Constant Field Valuespublic static final java.lang.String CSV_OUTPUT
OUTPUT_STYLE
,
Constant Field Valuespublic static final java.lang.String TERSE_OUTPUT
OUTPUT_STYLE
,
Constant Field Valuespublic static final java.lang.String VERBOSE_OUTPUT
OUTPUT_STYLE
,
Constant Field Valuespublic static final java.lang.String[] OUTPUT_STYLES
public static final java.lang.String[] LIMIT_OUTPUT_OUTPUT_STYLES
public static final java.lang.String DEFAULT_OUTPUT_STYLE
OUTPUT_STYLE
,
Constant Field Valuespublic static final java.lang.String SOURCE_A_NAME
public static final java.lang.String SOURCE_B_NAME
public static final java.lang.String DEFAULT_SOURCE_A
public static final java.lang.String DEFAULT_SOURCE_B
public static final java.lang.String COMPARISON_LIST
public PTF_Comparison()
public PTF_Comparison(PIRL.Configuration.Configuration configuration) throws PIRL.Configuration.Configuration_Exception
configuration
- the configuration.PIRL.Configuration.Configuration_Exception
- if there is a problem with the
configuration.public void configure(PIRL.Configuration.Configuration configuration)
configuration
- the configuration.output_style
public void set_ignored_fields(java.lang.String filename) throws java.io.FileNotFoundException, Invalid_Argument_Exception
If filename is not null, it is assumed to be the pathname to the configuration file for JPL's ptf_validate application, which lists the field index of the PTF fields to be compared (not skipped). This method adds the fields that are not listed, since they are implied to be skipped. Note that the field index in this case starts at 1, not at 0.
If the filename is null, the contents of the set of skipped fields
is extracted from the operator's configuration file. The values are taken
from the SKIPPED_FIELDS
parameter, which can be a PVL Value.ARRAY
or a single value. If a particular value is not a valid PTF
field name, it is silently ignored.
filename
- the name of the ptf_validate configuration
file. May be null.java.io.FileNotFoundException
- if the configuration file cannot be found
or cannot be read.Invalid_Argument_Exception
- if the configuration file does not
appear to be valid.public java.lang.String output_style()
OUTPUT_STYLES
public void output_style(java.lang.String output_style) throws Invalid_Argument_Exception
output_style
- the new display mode.Invalid_Argument_Exception
- if output_style is not valid
value.OUTPUT_STYLES
public java.util.HashMap<java.lang.String,java.lang.String> source_a_bad()
public void source_a_bad(java.util.HashMap<java.lang.String,java.lang.String> source_a_bad)
public java.util.HashMap<java.lang.String,java.lang.String> source_b_bad()
public void source_b_bad(java.util.HashMap<java.lang.String,java.lang.String> source_b_bad)
public void add(PTF_Comparison.Field_Pair pair)
pair
- the new PTF field pair.public void add(java.lang.String observation_id, java.lang.String field_name, java.lang.String value_a, java.lang.String value_b)
public void remove(int index)
index
- the index of the field pair to remove.public PTF_Comparison.Field_Pair get(int index)
index
- the index of the field pair to get.public int size()
public java.lang.String display(java.lang.String output_style) throws Invalid_Argument_Exception
Only fields that are not marked as hidden in the configuration ar displayed.
output_style
- The display mode to display, or null for default.Invalid_Argument_Exception
configure(PIRL.Configuration.Configuration)
public java.lang.String display() throws Invalid_Argument_Exception
output_style
; the list's configuration can also
set the display mode.
Only fields that are not marked as hidden in the configuration are displayed.
Invalid_Argument_Exception
configure(PIRL.Configuration.Configuration)
public PIRL.PVL.Parameter parameter()
public static boolean is_valid_output_style(java.lang.String output_style)
output_style
- the putative display mode.Copyright \ (C) Arizona Board of Regents on behalf of the \ Planetary Image Research Laboratory, Lunar and \ Planetary Laboratory at the University of Arizona