grs.pds
Class PdsTestRecord

java.lang.Object
  |
  +--java.util.Dictionary
        |
        +--java.util.Hashtable
              |
              +--grs.pds.PdsTestRecord
All Implemented Interfaces:
Cloneable, Map, PdsRecord, Serializable
Direct Known Subclasses:
ChanEdrTestRecord, CmdEdrTestRecord, CorrectedGammaSpectraTestRecord, EkEdrTestRecord, EngEdrTestRecord, HendAveragedTestRecord, HendDerivedTestRecord, MsgEdrTestRecord, NsAveragedTestRecord, NsDerivedTestRecord, PefEdrTestRecord, PositionedEdrTestRecord, ProfileEdrTestRecord, PulserEdrTestRecord, SummedGammaSpectraTestRecord

public abstract class PdsTestRecord
extends Hashtable
implements PdsRecord

Base class for testing EDR data classes. It will just be a Hashtable mapping keys (column id's) to values (data). So testing will be done by comparing the values of two Hashtables, one constructed with getString()'s from the database, the other by the EDR class construction process.

See Also:
Serialized Form

Field Summary
static SimpleDateFormat PdsTimeFormat
          Java Date format corresponding to PDS's
static String UNAVAILABLE_STRING
          used when a column is not available for a certain test
 
Fields inherited from interface grs.pds.PdsRecord
GAMMA_CHANNELS, int10, int12, int2, int3, logger, MESSAGE_LENGTH, NS_MAX_EVENTS, PEF_COMMANDS, prec10, prec12, prec13, prec14, prec15, prec16, prec17, prec5, prec6, prec7, PROFILE_LENGTH, PROFILE_SIZE, PULSER_CHANNELS, QUERY_DATE_FMT, SC_ID
 
Constructor Summary
PdsTestRecord()
           
 
Method Summary
 boolean equals(PdsTestRecord test)
          Compare with another instance for equality.
static String md5sum(byte[] data)
          Find the MD5 sum for a given byte array.
 void readCommonHeader(DataInputStream in)
          Parse the common header from the query tool.
 
Methods inherited from class java.util.Hashtable
clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keys, keySet, put, putAll, remove, size, toString, values
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

UNAVAILABLE_STRING

public static final String UNAVAILABLE_STRING
used when a column is not available for a certain test

See Also:
Constant Field Values

PdsTimeFormat

public static SimpleDateFormat PdsTimeFormat
Java Date format corresponding to PDS's

Constructor Detail

PdsTestRecord

public PdsTestRecord()
Method Detail

equals

public boolean equals(PdsTestRecord test)
Compare with another instance for equality.

Parameters:
test - Test record to compare.
Returns:
True if records have the same values for all the keys in this instance, otherwise false.

md5sum

public static final String md5sum(byte[] data)
Find the MD5 sum for a given byte array.

Parameters:
data - Any array of bytes.
Returns:
The MD5 hash string.

readCommonHeader

public void readCommonHeader(DataInputStream in)
                      throws IOException
Parse the common header from the query tool. Updated to use xtra header size field to be forward compatible.

Parameters:
in - Stream from query tool binary output (big-endian)
Throws:
IOException - Error reading from stream.


2001 Mars Odyssey Gamma Ray Spectrometer Team