public class DateTimeLogDetail extends LogDetail
Modifier and Type | Field and Description |
---|---|
protected Date |
date |
protected SimpleDateFormat |
dateFormat |
protected Date |
defaultDate |
emptyValue, name, pattern, required
Constructor and Description |
---|
DateTimeLogDetail(String name,
String pattern,
boolean required,
String inputFormat)
Create a new DateTimeLogDetail with the specified name, pattern,
requirement, and input format.
|
DateTimeLogDetail(String name,
String pattern,
boolean required,
String inputFormat,
String defaultDate)
Create a new DateTimeLogDetail with the specified name, pattern,
requirement, input format, and default date.
|
Modifier and Type | Method and Description |
---|---|
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.
|
String |
getDate(String outputFormat)
Get the date stored by the log detail, formatted according to the format
provided as a parameter.
|
String |
getFormat()
Get a String representing the format used to interpret an input String
into a String.
|
String |
getType()
Get the type (i.e.
|
void |
reset()
Reset the value contained within the LogDetail object.
|
void |
setDate(String value)
Set the date of the log detail, using the log detail date format to
transform the given String into a Date.
|
String |
toString()
Represent the value stored in the LogDetail as a String.
|
getEmptyValue, getName, getPattern, isRequired, setEmptyValue
protected Date date
protected Date defaultDate
protected SimpleDateFormat dateFormat
public DateTimeLogDetail(String name, String pattern, boolean required, String inputFormat, String defaultDate) throws 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.ParseException
- If the String provided as the default date
cannot be parsed.public DateTimeLogDetail(String name, String pattern, boolean required, 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 String getFormat()
public String getDate(String outputFormat)
outputFormat
- A String used to create a SimpleDateFormat
that formats the stored Date
as a String.public String getDate(DateTimeLogDetail inputDetail)
inputDetail
- The DateTimeLogDetail storing the log detail date
as extracted from the input log detail.public String getType()
LogDetail
public void setDate(String value) throws ParseException
value
- The new date of the log detail.ParseException
public void reset()
LogDetail
Copyright © 2010–2017 Planetary Data System. All rights reserved.