public class DataRecord
extends java.lang.Object
implements java.io.Serializable
Constructor and Description |
---|
DataRecord()
Creates a new DataRecord object with no name
|
DataRecord(java.lang.String recName)
Creates a new DataRecord object.
|
Modifier and Type | Method and Description |
---|---|
void |
addEnumFieldValue(java.lang.String fieldName,
java.lang.String fieldValue)
Add an enumerated value to the given field.
|
void |
addIntFieldValue(java.lang.String fieldName,
java.lang.Integer fieldValue)
Add an integer value to the given field.
|
void |
addLocationFieldValue(java.lang.String fieldName,
Location fieldValue)
Add a location value to the given field.
|
void |
addMeasureFieldValue(java.lang.String fieldName,
Measure fieldValue)
Add a measure value to the given field.
|
void |
addTextFieldValue(java.lang.String fieldName,
java.lang.String fieldValue)
Add a text value to the given field.
|
void |
addTimeFieldValue(java.lang.String fieldName,
TimeSpan fieldValue)
Add a time value to the given field.
|
java.util.Set<java.lang.String> |
getAllFieldNames()
Get the set of all field names set in this data record
|
java.lang.String |
getEnumField(java.lang.String fieldName)
Gets the value for a particular enumerated value field.
|
java.util.Set<java.lang.String> |
getEnumFieldNames()
Get the set of the enumerated value field names contained within this
DataRecord.
|
java.util.Set<java.lang.String> |
getEnumValues(java.lang.String fieldName)
Get the set of enumerated values for the given fieldName
|
java.lang.String |
getFieldAsString(java.lang.String fieldName)
Gets the value of the specified field, converted to a String.
|
DataType |
getFieldType(java.lang.String fieldName)
Get the type of data for this field
|
double |
getFloatField(java.lang.String fieldName)
Gets the value for a particular floating point field.
|
int |
getIntField(java.lang.String fieldName)
Gets the value for a particular integer field.
|
java.util.Set<java.lang.String> |
getIntFieldNames()
Get the set of the integer field names contained within this DataRecord
|
java.util.Set<java.lang.Integer> |
getIntValues(java.lang.String fieldName)
Get the set of integer values for the given fieldName
|
java.lang.String |
getLink()
Get the link associated with this record.
|
Location |
getLocationField(java.lang.String fieldName)
Gets the value for a particular location field.
|
java.util.Set<java.lang.String> |
getLocationFieldNames()
Get the set of the location field names contained within this DataRecord
|
java.util.Set<Location> |
getLocationValues(java.lang.String fieldName)
Get the set of location values for the given fieldName
|
Measure |
getMeasureField(java.lang.String fieldName)
Gets the value for a particular measure field.
|
java.util.Set<java.lang.String> |
getMeasureFieldNames()
Get the set of the measure field names contained within this DataRecord
|
java.util.Set<Measure> |
getMeasureValues(java.lang.String fieldName)
Get the set of measure values for the given fieldName
|
java.lang.String |
getName()
Gets the name of this DataRecord
|
java.lang.String |
getTextField(java.lang.String fieldName)
Gets the value for a particular text field.
|
java.util.Set<java.lang.String> |
getTextFieldNames()
Get the set of the text field names contained within this DataRecord
|
java.util.Set<java.lang.String> |
getTextValues(java.lang.String fieldName)
Get the set of text values for the given fieldName
|
TimeSpan |
getTimeField(java.lang.String fieldName)
Gets the value for a particular time field.
|
java.util.Set<java.lang.String> |
getTimeFieldNames()
Get the set of the time field names contained within this DataRecord
|
java.util.Set<TimeSpan> |
getTimeValues(java.lang.String fieldName)
Get the set of time values for the given fieldName
|
boolean |
isMultiValued(java.lang.String fieldName)
Return whether the given field has multiple values.
|
void |
mergeData(DataRecord otherRecord)
Merges the data from another DataRecord with this one.
|
void |
parseDataField(java.lang.String fieldName,
java.lang.String dataString)
Attempt to add a data element based upon how the data string parses.
|
void |
removeEnumFieldValue(java.lang.String fieldName,
java.lang.String fieldValue)
Remove an enumerated value from the set of values for the given
fieldName.
|
void |
removeField(java.lang.String fieldName)
remove the values and key for the specified fieldName.
|
void |
removeIntFieldValue(java.lang.String fieldName,
java.lang.Integer fieldValue)
Remove an integer value from the set of values for the given fieldName.
|
void |
removeLocationFieldValue(java.lang.String fieldName,
Location fieldValue)
Remove a location value from the set of values for the given fieldName.
|
void |
removeMeasureFieldValue(java.lang.String fieldName,
Measure fieldValue)
Remove a measure value from the set of values for the given fieldName.
|
void |
removeTextFieldValue(java.lang.String fieldName,
java.lang.String fieldValue)
Remove a string value from the set of values for the given fieldName.
|
void |
removeTimeFieldValue(java.lang.String fieldName,
TimeSpan fieldValue)
Remove a timespan value from the set of values for the given fieldName.
|
void |
setEnumField(java.lang.String fieldName,
java.lang.String fieldValue)
Sets the value for a particular enumerated field.
|
void |
setFloatField(java.lang.String fieldName,
double fieldValue)
Sets the value for a particular data field.
|
void |
setIntField(java.lang.String fieldName,
java.lang.Integer fieldValue)
Sets the value for a particular text field.
|
void |
setLink(java.lang.String linkString)
Set the link associated with this record.
|
void |
setLocationField(java.lang.String fieldName,
Location fieldValue)
Sets the value for a particular location field.
|
void |
setMeasureField(java.lang.String fieldName,
Measure fieldValue)
Sets the value for a particular measure field.
|
void |
setName(java.lang.String recName)
Set the name for this data record
|
void |
setTextField(java.lang.String fieldName,
java.lang.String fieldValue)
Sets the value for a particular text field.
|
void |
setTimeField(java.lang.String fieldName,
TimeSpan fieldValue)
Sets the value for a particular time field.
|
java.lang.String |
toString()
Return a string representation of the DataRecord.
|
java.util.Map<java.lang.String,java.lang.String> |
writeFieldsToMap()
Create a map with all fields and their values represented as strings.
|
java.lang.String |
writeFieldsToString()
Create a string containing the content of all fields in this DataRecord.
|
public DataRecord()
public DataRecord(java.lang.String recName)
recName
- the name of this DataRecordpublic void addEnumFieldValue(java.lang.String fieldName, java.lang.String fieldValue)
fieldName
- the name of the enumerated fieldfieldValue
- the value of the enumerated fieldpublic void addIntFieldValue(java.lang.String fieldName, java.lang.Integer fieldValue)
fieldName
- the name of the integer fieldfieldValue
- the value of the integer fieldpublic void addLocationFieldValue(java.lang.String fieldName, Location fieldValue)
fieldName
- the name of the location fieldfieldValue
- the value of the location fieldpublic void addMeasureFieldValue(java.lang.String fieldName, Measure fieldValue)
fieldName
- the name of the measure fieldfieldValue
- the value of the measure fieldpublic void addTextFieldValue(java.lang.String fieldName, java.lang.String fieldValue)
fieldName
- the name of the text fieldfieldValue
- the value of the text fieldpublic void addTimeFieldValue(java.lang.String fieldName, TimeSpan fieldValue)
fieldName
- the name of the time fieldfieldValue
- the value of the time fieldpublic java.util.Set<java.lang.String> getAllFieldNames()
public java.lang.String getEnumField(java.lang.String fieldName)
fieldName
- the name of the enumerated value fieldpublic java.util.Set<java.lang.String> getEnumFieldNames()
public java.util.Set<java.lang.String> getEnumValues(java.lang.String fieldName)
fieldName
- the name of the enumerated fieldpublic java.lang.String getFieldAsString(java.lang.String fieldName)
fieldName
- the field namepublic DataType getFieldType(java.lang.String fieldName)
fieldName
- the field namepublic double getFloatField(java.lang.String fieldName)
fieldName
- the name of the floating point fieldpublic int getIntField(java.lang.String fieldName)
fieldName
- the name of the integer fieldpublic java.util.Set<java.lang.String> getIntFieldNames()
public java.util.Set<java.lang.Integer> getIntValues(java.lang.String fieldName)
fieldName
- the name of the integer fieldpublic java.lang.String getLink()
public Location getLocationField(java.lang.String fieldName)
fieldName
- the name of the location fieldpublic java.util.Set<java.lang.String> getLocationFieldNames()
public java.util.Set<Location> getLocationValues(java.lang.String fieldName)
fieldName
- the name of the locaation fieldpublic Measure getMeasureField(java.lang.String fieldName)
fieldName
- the name of the measure fieldpublic java.util.Set<java.lang.String> getMeasureFieldNames()
public java.util.Set<Measure> getMeasureValues(java.lang.String fieldName)
fieldName
- the name of the measure fieldpublic java.lang.String getName()
public java.lang.String getTextField(java.lang.String fieldName)
fieldName
- the name of the text fieldpublic java.util.Set<java.lang.String> getTextFieldNames()
public java.util.Set<java.lang.String> getTextValues(java.lang.String fieldName)
fieldName
- the name of the text fieldpublic TimeSpan getTimeField(java.lang.String fieldName)
fieldName
- the name of the time fieldpublic java.util.Set<java.lang.String> getTimeFieldNames()
public java.util.Set<TimeSpan> getTimeValues(java.lang.String fieldName)
fieldName
- the name of the time fieldpublic boolean isMultiValued(java.lang.String fieldName)
fieldName
- the name of the fieldpublic void mergeData(DataRecord otherRecord)
otherRecord
- The other node to merge with this node.public void parseDataField(java.lang.String fieldName, java.lang.String dataString)
fieldName
- the field namedataString
- the data string which is parsed and storedpublic void removeEnumFieldValue(java.lang.String fieldName, java.lang.String fieldValue)
fieldName
- The field name for the enumerated valuefieldValue
- The value to removepublic void removeField(java.lang.String fieldName)
fieldName
- the field to be clearedpublic void removeIntFieldValue(java.lang.String fieldName, java.lang.Integer fieldValue)
fieldName
- The field name for the integer valuefieldValue
- The value to removepublic void removeLocationFieldValue(java.lang.String fieldName, Location fieldValue)
fieldName
- The field name for the location valuefieldValue
- The value to removepublic void removeMeasureFieldValue(java.lang.String fieldName, Measure fieldValue)
fieldName
- The field name for the measure valuefieldValue
- The value to removepublic void removeTextFieldValue(java.lang.String fieldName, java.lang.String fieldValue)
fieldName
- The field name for the string valuefieldValue
- The value to removepublic void removeTimeFieldValue(java.lang.String fieldName, TimeSpan fieldValue)
fieldName
- The field name for the timespan valuefieldValue
- The value to removepublic void setEnumField(java.lang.String fieldName, java.lang.String fieldValue)
fieldName
- the name of the enumerated fieldfieldValue
- the value of the enumerated fieldpublic void setFloatField(java.lang.String fieldName, double fieldValue)
fieldName
- the name of the text fieldfieldValue
- the value of the text fieldpublic void setIntField(java.lang.String fieldName, java.lang.Integer fieldValue)
fieldName
- the name of the text fieldfieldValue
- the value of the text fieldpublic void setLink(java.lang.String linkString)
linkString
- the link associated with the recordpublic void setLocationField(java.lang.String fieldName, Location fieldValue)
fieldName
- the name of the location fieldfieldValue
- the value of the location fieldpublic void setMeasureField(java.lang.String fieldName, Measure fieldValue)
fieldName
- the name of the measure fieldfieldValue
- the value of the measure fieldpublic void setName(java.lang.String recName)
recName
- the record namepublic void setTextField(java.lang.String fieldName, java.lang.String fieldValue)
fieldName
- the name of the text fieldfieldValue
- the value of the text fieldpublic void setTimeField(java.lang.String fieldName, TimeSpan fieldValue)
fieldName
- the name of the time fieldfieldValue
- the value of the time fieldpublic java.lang.String toString()
toString
in class java.lang.Object
public java.util.Map<java.lang.String,java.lang.String> writeFieldsToMap()
public java.lang.String writeFieldsToString()