HiRISE

HiRISE.HiPlan.PTF
Class PTF_Comparison

java.lang.Object
  extended by HiRISE.HiPlan.PTF.PTF_Comparison

public class PTF_Comparison
extends Object

A list containing PTF field values and their corresponding HiCat fields or another PTF field values.

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.

Version:
1.23
Author:
Ben Pearson, Jeremy Raynes - UA/PIRL
See Also:
"Payload Target File and Integrated Payload Target File Software Interface Specification (JPL MRO SEQ032)"

Nested Class Summary
static class PTF_Comparison.Field_Pair
          A pair of observation field values from two different sources.
 
Field Summary
static String COMPARISON_LIST
           
static String CSV_OUTPUT
          The value for the display mode parameter that results in a comma-separated value display.
static String DEFAULT_OUTPUT_STYLE
          The default display mode.
static String DEFAULT_SOURCE_A
           
static String DEFAULT_SOURCE_B
           
static String ID
          Class identification name with source code version and date.
static String[] LIMIT_OUTPUT_OUTPUT_STYLES
          The set of display modes not to print outside information.
static String OUTPUT_STYLE
          The parameter name for the configuration parameter controlling the list's display mode.
static String[] OUTPUT_STYLES
          The set of display modes.
static String PVL_OUTPUT
          The value for the display mode parameter that results in a PVL parameter display.
static String SOURCE_A_NAME
           
static String SOURCE_B_NAME
           
static String TERSE_OUTPUT
          The value for the display mode parameter that results in a terse, informational display.
static String VERBOSE_OUTPUT
          The value for the display mode parameter that results in a verbose display.
 
Constructor Summary
PTF_Comparison()
          Creates a new record list using default configuration values.
PTF_Comparison(Configuration configuration)
          Creates a new record list using the indicated configuration.
 
Method Summary
 void add(PTF_Comparison.Field_Pair pair)
          Adds a new field pair.
 void add(String observation_id, String field_name, String value_a, String value_b)
           
 void configure(Configuration configuration)
          Sets the list's configuration.
 String display()
          Returns a text representation of the list.
 String display(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(String output_style)
          Tests whether a given display mode is a valid one.
 String output_style()
          Gets the display mode.
 void output_style(String output_style)
          Sets the display mode.
 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(String filename)
          Builds the set of ignored fields.
 int size()
          Returns the number of entries in the list.
 HashMap<String,String> source_a_bad()
           
 void source_a_bad(HashMap<String,String> source_a_bad)
           
 HashMap<String,String> source_b_bad()
           
 void source_b_bad(HashMap<String,String> source_b_bad)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ID

public static final String ID
Class identification name with source code version and date.

See Also:
Constant Field Values

OUTPUT_STYLE

public static final String OUTPUT_STYLE
The parameter name for the configuration parameter controlling the list's display mode. The search for this parameter is case-insensitive.

See Also:
Constant Field Values

PVL_OUTPUT

public static final String PVL_OUTPUT
The value for the display mode parameter that results in a PVL parameter display. The value is case-insensitive.

See Also:
OUTPUT_STYLE, Constant Field Values

CSV_OUTPUT

public static final String CSV_OUTPUT
The value for the display mode parameter that results in a comma-separated value display. The value is case-insensitive.

See Also:
OUTPUT_STYLE, Constant Field Values

TERSE_OUTPUT

public static final String TERSE_OUTPUT
The value for the display mode parameter that results in a terse, informational display. The value is case-insensitive.

See Also:
OUTPUT_STYLE, Constant Field Values

VERBOSE_OUTPUT

public static final String VERBOSE_OUTPUT
The value for the display mode parameter that results in a verbose display. The value is case-insensitive.

See Also:
OUTPUT_STYLE, Constant Field Values

OUTPUT_STYLES

public static final String[] OUTPUT_STYLES
The set of display modes.


LIMIT_OUTPUT_OUTPUT_STYLES

public static final String[] LIMIT_OUTPUT_OUTPUT_STYLES
The set of display modes not to print outside information.


DEFAULT_OUTPUT_STYLE

public static final String DEFAULT_OUTPUT_STYLE
The default display mode.

See Also:
OUTPUT_STYLE, Constant Field Values

SOURCE_A_NAME

public static final String SOURCE_A_NAME
See Also:
Constant Field Values

SOURCE_B_NAME

public static final String SOURCE_B_NAME
See Also:
Constant Field Values

DEFAULT_SOURCE_A

public static final String DEFAULT_SOURCE_A
See Also:
Constant Field Values

DEFAULT_SOURCE_B

public static final String DEFAULT_SOURCE_B
See Also:
Constant Field Values

COMPARISON_LIST

public static final String COMPARISON_LIST
See Also:
Constant Field Values
Constructor Detail

PTF_Comparison

public PTF_Comparison()
Creates a new record list using default configuration values.


PTF_Comparison

public PTF_Comparison(Configuration configuration)
               throws Configuration_Exception
Creates a new record list using the indicated configuration.

Parameters:
configuration - the configuration.
Throws:
Configuration_Exception - if there is a problem with the configuration.
Method Detail

configure

public void configure(Configuration configuration)
Sets the list's configuration. The configuration can control the display mode and the set of fields to hide from display.

Parameters:
configuration - the configuration.
See Also:
output_style

set_ignored_fields

public void set_ignored_fields(String filename)
                        throws FileNotFoundException,
                               Invalid_Argument_Exception
Builds the set of ignored fields. The contents of the set can be specified in two ways:

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.

Parameters:
filename - the name of the ptf_validate configuration file. May be null.
Throws:
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.

output_style

public String output_style()
Gets the display mode.

Returns:
output_style the current display mode.
See Also:
OUTPUT_STYLES

output_style

public void output_style(String output_style)
                  throws Invalid_Argument_Exception
Sets the display mode. The mode name is converted to uppercase.

Parameters:
output_style - the new display mode.
Throws:
Invalid_Argument_Exception - if output_style is not valid value.
See Also:
OUTPUT_STYLES

source_a_bad

public HashMap<String,String> source_a_bad()

source_a_bad

public void source_a_bad(HashMap<String,String> source_a_bad)

source_b_bad

public HashMap<String,String> source_b_bad()

source_b_bad

public void source_b_bad(HashMap<String,String> source_b_bad)

add

public void add(PTF_Comparison.Field_Pair pair)
Adds a new field pair.

Parameters:
pair - the new PTF field pair.

add

public void add(String observation_id,
                String field_name,
                String value_a,
                String value_b)

remove

public void remove(int index)
Removes the field pair from the list at the indicated index.

Parameters:
index - the index of the field pair to remove.

get

public PTF_Comparison.Field_Pair get(int index)
Returns a field pair from the list at the indicated index.

Parameters:
index - the index of the field pair to get.
Returns:
the field pair at the index.

size

public int size()
Returns the number of entries in the list.

Returns:
the size of the list.

display

public String display(String output_style)
               throws Invalid_Argument_Exception
Returns a text representation of the list. The style of the display is governed by the input parameter, or if null, the (@link #output_style).

Only fields that are not marked as hidden in the configuration ar displayed.

Parameters:
output_style - The display mode to display, or null for default.
Returns:
a formatted text representation of the list.
Throws:
Invalid_Argument_Exception
See Also:
configure(PIRL.Configuration.Configuration)

display

public String display()
               throws Invalid_Argument_Exception
Returns a text representation of the list. The style of the display is governed by the 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.

Returns:
a formatted text representation of the list.
Throws:
Invalid_Argument_Exception
See Also:
configure(PIRL.Configuration.Configuration)

parameter

public Parameter parameter()
Returns a PVL parameter representation of the list.

Returns:
the parameter representation of the list.

is_valid_output_style

public static boolean is_valid_output_style(String output_style)
Tests whether a given display mode is a valid one.

Parameters:
output_style - the putative display mode.
Returns:
true if output_style is valid; false otherwise.

HiRISE

Copyright (C) Arizona Board of Regents on behalf of the Planetary Image Research Laboratory, Lunar and Planetary Laboratory at the University of Arizona