public abstract class AbstractMarsRecord extends AbstractJsonConvertibleRecord implements MarsRecord
MarsRecord
types: Molecule
and
MarsMetadata
. All MarsRecord
s have a basic set of properties
including a UID, notes, tags, parameters, a MarsTable
,
MarsRegion
s, and MarsPosition
s. MarsRecord
s can be
serialized to and from Json.
This basic set of properties is extended for storage of molecule information
and metadata information in Molecule
, AbstractMolecule
,
MarsMetadata
, AbstractMarsMetadata
.
Modifier and Type | Field and Description |
---|---|
protected MoleculeArchive<? extends Molecule,? extends MarsMetadata,? extends MoleculeArchiveProperties<?,?>,? extends MoleculeArchiveIndex<?,?>> |
parent
Reference to MoleculeArchive containing the record.
|
Constructor and Description |
---|
AbstractMarsRecord()
Constructor for creating an empty MarsRecord.
|
AbstractMarsRecord(java.lang.String UID)
Constructor for creating an empty MarsRecord with the specified UID.
|
Modifier and Type | Method and Description |
---|---|
void |
addNote(java.lang.String note)
Add to any notes already in the record.
|
void |
addTag(java.lang.String tag)
Add a string tag to the record.
|
protected void |
createIOMaps()
Must be implemented in subclasses to define how fields, objects, arrays
should be saved based on the Jackson streaming API.
|
boolean |
getBooleanParameter(java.lang.String parameter)
Get the value of a boolean parameter.
|
java.lang.String |
getNotes()
Get notes for this record.
|
double |
getParameter(java.lang.String parameter)
Get the value of a parameter.
|
java.util.LinkedHashMap<java.lang.String,java.lang.Object> |
getParameters()
Get the map for all parameters.
|
MarsPosition |
getPosition(java.lang.String name)
Get a
MarsPosition . |
java.util.Set<java.lang.String> |
getPositionNames()
Get the set of position names contained in this record.
|
java.util.LinkedHashMap<java.lang.String,MarsPosition> |
getPositions()
Get the map for all positions.
|
MarsRegion |
getRegion(java.lang.String name)
Get a
MarsRegion . |
java.util.Set<java.lang.String> |
getRegionNames()
Get the set of region names contained in this record.
|
java.util.LinkedHashMap<java.lang.String,MarsRegion> |
getRegions()
Get the map for all regions.
|
java.lang.String |
getStringParameter(java.lang.String parameter)
Get the value of a string parameter.
|
java.util.LinkedHashSet<java.lang.String> |
getTags()
Get the set of all tags.
|
java.lang.String[] |
getTagsArray()
Get an array list of all tags.
|
java.lang.String |
getUID()
Get the UID for this record.
|
boolean |
hasBooleanParameter(java.lang.String parameter)
Returns true if the boolean parameter exists.
|
boolean |
hasDoubleParameter(java.lang.String parameter)
Returns true if the double parameter exists.
|
boolean |
hasNoTags()
Check if the record has no tags.
|
boolean |
hasParameter(java.lang.String parameter)
Returns true if any type of parameters has the name give.
|
boolean |
hasPosition(java.lang.String name)
Check if the record contains a
MarsPosition using the name. |
boolean |
hasRegion(java.lang.String name)
Check if the record contains a
MarsRegion using the name. |
boolean |
hasStringParameter(java.lang.String parameter)
Returns true if the string parameter exists.
|
boolean |
hasTag(java.lang.String tag)
Check if the record has a tag.
|
void |
merge(MarsRecord record)
Merge another MarsRecord into this one.
|
void |
putPosition(MarsPosition positionOfInterest)
Add or update a
MarsPosition . |
void |
putRegion(MarsRegion regionOfInterest)
Add or update a
MarsRegion . |
void |
removeAllParameters()
Remove all parameter values from the record.
|
void |
removeAllPositions()
Remove all positions from the record.
|
void |
removeAllRegions()
Remove all regions from the record.
|
void |
removeAllTags()
Remove all tags from the record.
|
void |
removeParameter(java.lang.String parameter)
Remove parameter.
|
void |
removePosition(java.lang.String name)
Remove a
MarsPosition from the record using the name. |
void |
removeRegion(java.lang.String name)
Remove a
MarsRegion from the record using the name. |
void |
removeTag(java.lang.String tag)
Remove a string tag from the record.
|
void |
setNotes(java.lang.String notes)
Sets the notes for this record.
|
void |
setParameter(java.lang.String parameter,
boolean value)
Add or update a parameter value.
|
void |
setParameter(java.lang.String parameter,
double value)
Add or update a parameter value.
|
void |
setParameter(java.lang.String parameter,
java.lang.String value)
Add or update a parameter value.
|
void |
setParent(MoleculeArchive<? extends Molecule,? extends MarsMetadata,? extends MoleculeArchiveProperties<?,?>,? extends MoleculeArchiveIndex<?,?>> archive)
Set the parent
MoleculeArchive that this record is stored in. |
dumpJSON, fromJSON, getJsonGenerator, getJsonParser, setJsonField, setShowWarnings, toJSON
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
dumpJSON, fromJSON, getJsonGenerator, getJsonParser, setJsonField, setShowWarnings, toJSON
protected MoleculeArchive<? extends Molecule,? extends MarsMetadata,? extends MoleculeArchiveProperties<?,?>,? extends MoleculeArchiveIndex<?,?>> parent
public AbstractMarsRecord()
public AbstractMarsRecord(java.lang.String UID)
UID
- The unique identifier for this MarsRecord.protected void createIOMaps()
AbstractJsonConvertibleRecord
createIOMaps
in class AbstractJsonConvertibleRecord
public java.lang.String getUID()
getUID
in interface MarsRecord
public java.lang.String getNotes()
getNotes
in interface MarsRecord
public void setNotes(java.lang.String notes)
setNotes
in interface MarsRecord
notes
- Any notes about this molecule.public void addNote(java.lang.String note)
addNote
in interface MarsRecord
note
- String with the note to add to the record.public void addTag(java.lang.String tag)
addTag
in interface MarsRecord
tag
- The string tag to be added.public boolean hasTag(java.lang.String tag)
hasTag
in interface MarsRecord
tag
- The string tag to check for.public boolean hasNoTags()
hasNoTags
in interface MarsRecord
public java.util.LinkedHashSet<java.lang.String> getTags()
getTags
in interface MarsRecord
public java.lang.String[] getTagsArray()
getTagsArray
in interface MarsRecord
public void removeTag(java.lang.String tag)
removeTag
in interface MarsRecord
tag
- The string tag to remove.public void removeAllTags()
removeAllTags
in interface MarsRecord
public void setParameter(java.lang.String parameter, double value)
setParameter
in interface MarsRecord
parameter
- The string parameter name.value
- The double value to set for the parameter name.public void setParameter(java.lang.String parameter, java.lang.String value)
setParameter
in interface MarsRecord
parameter
- The string parameter name.value
- The string value to set for the parameter name.public void setParameter(java.lang.String parameter, boolean value)
setParameter
in interface MarsRecord
parameter
- The string parameter name.value
- The boolean value to set for the parameter name.public void removeAllParameters()
removeAllParameters
in interface MarsRecord
public void removeParameter(java.lang.String parameter)
removeParameter
in interface MarsRecord
parameter
- The parameter name to remove.public double getParameter(java.lang.String parameter)
getParameter
in interface MarsRecord
parameter
- The string parameter name to retrieve the value for.public java.lang.String getStringParameter(java.lang.String parameter)
getStringParameter
in interface MarsRecord
parameter
- The string parameter name to retrieve the value for.public boolean getBooleanParameter(java.lang.String parameter)
getBooleanParameter
in interface MarsRecord
parameter
- The parameter name to retrieve.public boolean hasParameter(java.lang.String parameter)
hasParameter
in interface MarsRecord
parameter
- The parameter name to check for.public boolean hasDoubleParameter(java.lang.String parameter)
hasDoubleParameter
in interface MarsRecord
parameter
- The double parameter name to check for.public boolean hasStringParameter(java.lang.String parameter)
hasStringParameter
in interface MarsRecord
parameter
- The string parameter name to check for.public boolean hasBooleanParameter(java.lang.String parameter)
hasBooleanParameter
in interface MarsRecord
parameter
- The boolean parameter name to check for.public java.util.LinkedHashMap<java.lang.String,java.lang.Object> getParameters()
getParameters
in interface MarsRecord
public void putRegion(MarsRegion regionOfInterest)
MarsRegion
. This can be a region of interest for
further analysis steps: slope calculations or KCP calculations
KCPCommand
. Region names are unique. If a region that has this name
already exists in the record it will be overwritten by this method.putRegion
in interface MarsRecord
regionOfInterest
- The region to add to the record.public MarsRegion getRegion(java.lang.String name)
MarsRegion
. Region names are unique. Only one copy of each
region can be stored in the record.getRegion
in interface MarsRecord
name
- The name of the region to retrieve.public boolean hasRegion(java.lang.String name)
MarsRegion
using the name.hasRegion
in interface MarsRecord
name
- The name of the region to check for.public void removeRegion(java.lang.String name)
MarsRegion
from the record using the name.removeRegion
in interface MarsRecord
name
- The name of the region to remove.public void removeAllRegions()
removeAllRegions
in interface MarsRecord
public java.util.Set<java.lang.String> getRegionNames()
getRegionNames
in interface MarsRecord
public java.util.LinkedHashMap<java.lang.String,MarsRegion> getRegions()
getRegions
in interface MarsRecord
public void putPosition(MarsPosition positionOfInterest)
MarsPosition
. This can be a position of interest
for further analysis steps. Position names are unique. If a position with
has this name already exists in the record it will be overwritten by this
method.putPosition
in interface MarsRecord
positionOfInterest
- The position to add to the record.public MarsPosition getPosition(java.lang.String name)
MarsPosition
. Position names are unique. Only one copy of
each region can be stored in the record.getPosition
in interface MarsRecord
name
- The name of the position to retrieve.public boolean hasPosition(java.lang.String name)
MarsPosition
using the name.hasPosition
in interface MarsRecord
name
- The name of the position to check for.public void removePosition(java.lang.String name)
MarsPosition
from the record using the name.removePosition
in interface MarsRecord
name
- The name of the position to remove.public void removeAllPositions()
removeAllPositions
in interface MarsRecord
public java.util.Set<java.lang.String> getPositionNames()
getPositionNames
in interface MarsRecord
public java.util.LinkedHashMap<java.lang.String,MarsPosition> getPositions()
getPositions
in interface MarsRecord
public void merge(MarsRecord record)
merge
in interface MarsRecord
record
- The record to merge.public void setParent(MoleculeArchive<? extends Molecule,? extends MarsMetadata,? extends MoleculeArchiveProperties<?,?>,? extends MoleculeArchiveIndex<?,?>> archive)
MoleculeArchive
that this record is stored in.setParent
in interface MarsRecord
archive
- The MoleculeArchive
holding this record.