public class DateTimeLogDetail extends LogDetail
Modifier and Type | Field and Description |
---|---|
protected java.util.Date |
date |
protected java.text.SimpleDateFormat |
dateFormat |
protected java.util.Date |
defaultDate |
emptyValue, name, pattern, required
Constructor and Description |
---|
DateTimeLogDetail(java.lang.String name,
java.lang.String pattern,
boolean required,
java.lang.String inputFormat)
Create a new DateTimeLogDetail with the specified name, pattern,
requirement, and input format.
|
DateTimeLogDetail(java.lang.String name,
java.lang.String pattern,
boolean required,
java.lang.String inputFormat,
java.lang.String defaultDate)
Create a new DateTimeLogDetail with the specified name, pattern,
requirement, input format, and default date.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getDate(DateTimeLogDetail inputDetail)
This method is meant to be invoked on the DateTimeLogDetail that
represents the log detail in output and accepts the input
DateTimeLogDetail.
|
java.lang.String |
getDate(java.lang.String outputFormat)
Get the date stored by the log detail, formatted according to the format
provided as a parameter.
|
java.lang.String |
getFormat()
Get a String representing the format used to interpret an input String
into a String.
|
java.lang.String |
getType()
Get the type (i.e.
|
void |
reset()
Reset the value contained within the LogDetail object.
|
void |
setDate(java.lang.String value)
Set the date of the log detail, using the log detail date format to
transform the given String into a Date.
|
java.lang.String |
toString()
Represent the value stored in the LogDetail as a String.
|
getEmptyValue, getName, getPattern, isRequired, setEmptyValue
protected java.util.Date date
protected java.util.Date defaultDate
protected java.text.SimpleDateFormat dateFormat
public DateTimeLogDetail(java.lang.String name, java.lang.String pattern, boolean required, java.lang.String inputFormat, java.lang.String defaultDate) throws java.text.ParseException
name
- The name of the log detail.pattern
- The RE pattern used to extract the log detail
from the input log line.required
- Whether a value must be provided in the input
log line for the line to be considered valid.inputFormat
- The String used to create a
SimpleDateFormat
to translate String
input into a Date
object.defaultDate
- The default date of the log detail, represented
in a String format and interpreted by the input
format (the previous parameter) into a Date.java.text.ParseException
- If the String provided as the default date
cannot be parsed.public DateTimeLogDetail(java.lang.String name, java.lang.String pattern, boolean required, java.lang.String inputFormat)
name
- The name of the log detail.pattern
- The RE pattern used to extract the log detail
from the input log line.required
- Whether a value must be provided in the input
log line for the line to be considered valid.inputFormat
- The String used to create a
SimpleDateFormat
to translate String
input into a Date
object.public java.lang.String getFormat()
public java.lang.String getDate(java.lang.String outputFormat)
outputFormat
- A String used to create a SimpleDateFormat
that formats the stored Date
as a String.public java.lang.String getDate(DateTimeLogDetail inputDetail)
inputDetail
- The DateTimeLogDetail storing the log detail date
as extracted from the input log detail.public java.lang.String getType()
LogDetail
public void setDate(java.lang.String value) throws java.text.ParseException
value
- The new date of the log detail.java.text.ParseException
public void reset()
LogDetail
public java.lang.String toString()
LogDetail
Copyright © 2010-2018 Planetary Data System. All Rights Reserved.