public class PTF_Record_List
extends java.lang.Object
This class is not an implementation of the List
interface.
Modifier and Type | Class and Description |
---|---|
static class |
PTF_Record_List.Import_Exception
An exception for reporting problems during PTF record imports.
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ID
Class identification name with source code version and date.
|
Constructor and Description |
---|
PTF_Record_List()
Creates a new, empty record list.
|
PTF_Record_List(java.io.InputStream input_stream)
Creates a new list and populates it with data from an input stream.
|
PTF_Record_List(java.lang.String source)
Creates a new list and populates it with data from a given PTF source.
|
Modifier and Type | Method and Description |
---|---|
void |
add_record(PTF_Record record)
Adds a PTF record to this list.
|
void |
add_record(java.lang.String record_text)
Adds a PTF record to this list.
|
java.util.HashMap<java.lang.String,java.lang.String> |
bad_observations()
Gets the map of bad observations and the reasons they were marked as being
bad.
|
PTF_Comparison |
compare_with_hicat(Observation_Record_Broker broker)
Compares each PTF record in this list with its counterpart in HiCat via the
indicated record broker.
|
PTF_Comparison |
compare_with_ptf_record_list(PTF_Record_List target)
Compares each PTF record in this list with its counterpart in a target PTF.
|
PTF_Record |
get_record(java.lang.String observation_id)
Gets the named record from this list.
|
java.util.ArrayList |
observation_ids()
Gets the list of observation IDs for the records in this list.
|
void |
read_ptf(java.io.InputStream stream)
Populates the record list with data from an input stream.
|
void |
read_ptf(java.io.InputStream stream,
java.lang.String name)
Populates the record list with data from an input stream.
|
void |
read_ptf(java.lang.String source)
Populates the record list with data from a named file, which must be a PTF.
|
int |
record_count()
Gets the total number of records in this list.
|
public static final java.lang.String ID
public PTF_Record_List()
public PTF_Record_List(java.lang.String source) throws Invalid_Argument_Exception, java.io.IOException
source
- the PTF source.Invalid_Argument_Exception
- if the PTF is invalid.java.io.IOException
- if the PTF cannot be read.public PTF_Record_List(java.io.InputStream input_stream) throws Invalid_Argument_Exception, java.io.IOException
input_stream
- an input stream containing PTF data.Invalid_Argument_Exception
- if the PTF is invalid.java.io.IOException
- if the PTF cannot be read.public void read_ptf(java.io.InputStream stream, java.lang.String name) throws Invalid_Argument_Exception, java.io.IOException
If stream is null, no action is taken.
If a record is invalid, unidentified, or a duplicate of another record
as identified by the team database ID, it is added to a collection of
bad_observations
.
stream
- the input stream, which must contain a PTF.name
- the name of the stream, which may be null.Invalid_Argument_Exception
- if stream does not contain a
PTF.java.io.IOException
- if there is a problem reading the stream.public void read_ptf(java.io.InputStream stream) throws Invalid_Argument_Exception, java.io.IOException
If stream is null, no action is taken.
If a record is invalid, unidentified, or a duplicate of another record
as identified by the team database ID, it is added to a collection of
bad_observations
.
stream
- the input stream, which must contain a PTF.Invalid_Argument_Exception
- if stream does not contain a
PTF.java.io.IOException
- if there is a problem reading the stream.public void read_ptf(java.lang.String source) throws Invalid_Argument_Exception, java.io.IOException
The source may be a URL, a relative file pathname, or an absolute file pathname. If it is null, no action is taken.
If a record is invalid, unidentified, or a duplicate of another record
as identified by the team database ID, it is added to a collection of
bad_observations
.
source
- the source filename; the file must be a PTF.Invalid_Argument_Exception
- if source is not a PTF.java.io.IOException
- if the source cannot be read.public PTF_Comparison compare_with_hicat(Observation_Record_Broker broker) throws PIRL.Database.Database_Exception
bad_observations
.broker
- the broker that conducts operations with HiCat.PIRL.Database.Database_Exception
- if the database cannot be read or the user has
insuffcient access.public PTF_Comparison compare_with_ptf_record_list(PTF_Record_List target)
bad_observations
.target
- the target PTF list against which this list is compared.public PTF_Record get_record(java.lang.String observation_id)
observation_id
- the identifier for the record.public void add_record(PTF_Record record) throws PTF_Record_List.Import_Exception
If the observation already exists in this list, an PTF_Record_List.Import_Exception
is thrown with DUPLICATE
as the exception's import problem. If the
record has a trivial team database ID (that is, it is null or an
empty or whitespace string), an import exception is thrown with UNIDENTIFIED
as the exception's import problem.
record
- the PTF record to be added to the comparison list. If
null, no action is taken.PTF_Record_List.Import_Exception
- if there is a problem with the PTF record.public void add_record(java.lang.String record_text) throws PTF_Record_List.Import_Exception
PTF_Record_List.Import_Exception
is thrown with INVALID
as the exception's import problem.
If the observation already exists in this list, an PTF_Record_List.Import_Exception
is thrown with DUPLICATE
as the exception's import problem. If the
record has a trivial team database ID (that is, it is null or an
empty or whitespace string), an import exception is thrown with UNIDENTIFIED
as the exception's import problem.
record_text
- the text representation of the PTF record to be added.PTF_Record_List.Import_Exception
- if there is a problem with the PTF record.public java.util.ArrayList observation_ids()
public java.util.HashMap<java.lang.String,java.lang.String> bad_observations()
public int record_count()
Copyright \ (C) Arizona Board of Regents on behalf of the \ Planetary Image Research Laboratory, Lunar and \ Planetary Laboratory at the University of Arizona