public static class ProductData.UTC extends ProductData.UInt
ProductData.UTC
class is a ProductData.UInt
specialisation for UTC date/time
values.
Internally, data is stored in an int[3]
array which represents a Modified Julian Day 2000
(MJD
) as a days
, a seconds
and a micro-seconds
fraction.
ProductData.ASCII, ProductData.Byte, ProductData.Double, ProductData.Float, ProductData.Int, ProductData.Short, ProductData.UByte, ProductData.UInt, ProductData.UShort, ProductData.UTC
Modifier and Type | Field and Description |
---|---|
static String |
DATE_FORMAT_PATTERN
The default pattern used to format date strings.
|
static TimeZone |
UTC_TIME_ZONE
The default UTC time zone used by this class.
|
_array
TYPE_ASCII, TYPE_FLOAT32, TYPE_FLOAT64, TYPE_INT16, TYPE_INT32, TYPE_INT8, TYPE_UINT16, TYPE_UINT32, TYPE_UINT8, TYPE_UNDEFINED, TYPE_UTC, TYPESTRING_ASCII, TYPESTRING_FLOAT32, TYPESTRING_FLOAT64, TYPESTRING_INT16, TYPESTRING_INT32, TYPESTRING_INT8, TYPESTRING_UINT16, TYPESTRING_UINT32, TYPESTRING_UINT8, TYPESTRING_UTC
Constructor and Description |
---|
UTC()
Constructs a new
UTC value. |
UTC(double mjd)
Constructs a MJD2000 date instance.
|
UTC(int[] elems)
Constructs a MJD2000 date instance.
|
UTC(int days,
int seconds,
int microSeconds)
Constructs a MJD2000 date instance.
|
Modifier and Type | Method and Description |
---|---|
static ProductData.UTC |
create(Date date,
long micros)
Creates a new UTC instance based on the given time and microseconds fraction.
|
static Calendar |
createCalendar()
Gets the MJD 2000 calendar on which this UTC date/time is based.
|
static DateFormat |
createDateFormat()
Creates the MJD 2000 date format used to parse and format.
|
static DateFormat |
createDateFormat(String pattern)
Creates a date format using the given pattern.
|
protected ProductData |
createDeepClone()
Retuns a "deep" copy of this product data.
|
String |
format()
Formats this UTC date/time value as a string using the format
DATE_FORMAT_PATTERN and the default
MJD 2000 calendar. |
Calendar |
getAsCalendar()
Gets the MJD 2000 calendar on which this UTC date/time is based.
|
Date |
getAsDate()
Returns this UTC date/time value as a Date.
|
int |
getDaysFraction()
Returns the days fraction of the Modified Julian Day (MJD) as a signed integer (the 1st element of the
internal data array).
|
String |
getElemString()
Returns this UTC date/time value as a string using the format
DATE_FORMAT_PATTERN . |
long |
getMicroSecondsFraction()
Returns the micro-seconds fraction of the Modified Julian Day (MJD) as a signed integer (the 3rd element
of the internal data array).
|
double |
getMJD()
Returns the Modified Julian Day 2000 (MJD2000) represented by this UTC value as double value.
|
long |
getSecondsFraction()
Returns the seconds fraction of the Modified Julian Day (MJD) as a signed integer (the 2nd element of the
internal data array).
|
String |
getTypeString()
Returns this value's data type String.
|
static ProductData.UTC |
parse(String text)
Parses a UTC value given as text in MJD 2000 format.
|
static ProductData.UTC |
parse(String text,
DateFormat dateFormat)
Parses a UTC value given as text.
|
static ProductData.UTC |
parse(String text,
String pattern)
Parses a UTC value given as text.
|
getElemDoubleAt, getElemFloatAt, getElemIntAt, getElemStringAt, getElemUIntAt, setElems
dispose, getArray, getElems, getNumElems, readFrom, setElemDoubleAt, setElemFloatAt, setElemIntAt, setElemUIntAt, writeTo
createInstance, createInstance, createInstance, createInstance, createInstance, createInstance, createInstance, createInstance, createInstance, createInstance, createUnsignedInstance, createUnsignedInstance, createUnsignedInstance, equalElems, equals, getElemBoolean, getElemBooleanAt, getElemDouble, getElemFloat, getElemInt, getElemSize, getElemSize, getElemUInt, getType, getType, getTypeString, hashCode, isFloatingPointType, isInt, isIntType, isScalar, isSigned, isUIntType, isUnsigned, readFrom, readFrom, readFrom, setElemBoolean, setElemBooleanAt, setElemDouble, setElemFloat, setElemInt, setElemString, setElemStringAt, setElemUInt, toString, writeTo, writeTo, writeTo
public static final TimeZone UTC_TIME_ZONE
public static final String DATE_FORMAT_PATTERN
public UTC()
UTC
value.public UTC(int[] elems)
elems
- an array containg at least the three elements {days, seconds, microSeconds}
public UTC(int days, int seconds, int microSeconds)
days
- the number of days since 2000-01-01 00:00seconds
- the seconds fraction of the number of daysmicroSeconds
- the microseconds fraction of the number of dayspublic UTC(double mjd)
mjd
- the Modified Julian Day 2000 (MJD2000) as double valuegetMJD()
public static ProductData.UTC create(Date date, long micros)
date
- the UTC timemicros
- the microseconds fractionpublic static Calendar createCalendar()
getAsCalendar()
public static DateFormat createDateFormat()
createDateFormat(String)
with DATE_FORMAT_PATTERN
.public static DateFormat createDateFormat(String pattern)
createCalendar()
method.pattern
- the data format patternSimpleDateFormat
public static ProductData.UTC parse(String text) throws ParseException
parse(String, String)
using DATE_FORMAT_PATTERN
as pattern.text
- a UTC value given as textParseException
createCalendar()
,
createDateFormat()
public static ProductData.UTC parse(String text, String pattern) throws ParseException
text
- a UTC value given as textpattern
- the date/time patternParseException
createCalendar()
,
createDateFormat()
public static ProductData.UTC parse(String text, DateFormat dateFormat) throws ParseException
text
- a UTC value given as textdateFormat
- the date/time patternParseException
createCalendar()
,
createDateFormat()
public String format()
DATE_FORMAT_PATTERN
and the default
MJD 2000 calendar.createCalendar()
,
createDateFormat()
public String getElemString()
DATE_FORMAT_PATTERN
. Simply calls
format()
.getElemString
in class ProductData
null
protected ProductData createDeepClone()
createDeepClone
in class ProductData.UInt
public String getTypeString()
getTypeString
in class ProductData
public Calendar getAsCalendar()
createCalendar()
,
getAsDate()
public Date getAsDate()
getAsCalendar()
public double getMJD()
public int getDaysFraction()
getMJD()
public long getSecondsFraction()
getMJD()
public long getMicroSecondsFraction()
getMJD()
Copyright © 2014–2015 European Space Agency (ESA). All rights reserved.