public abstract class BaseDateTimeType extends PrimitiveType<Date>
| Constructor and Description |
|---|
BaseDateTimeType()
Constructor
|
BaseDateTimeType(Date theDate,
TemporalPrecisionEnum thePrecision)
Constructor
|
BaseDateTimeType(Date theDate,
TemporalPrecisionEnum thePrecision,
TimeZone theTimeZone)
Constructor
|
BaseDateTimeType(String theString)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(int theField,
int theValue)
Adds the given amount to the field specified by theField
|
boolean |
after(DateTimeType theDateTimeType) |
boolean |
before(DateTimeType theDateTimeType) |
protected String |
encode(Date theValue)
Subclasses must override to convert a "coerced" value into an encoded one.
|
protected abstract TemporalPrecisionEnum |
getDefaultPrecisionForDatatype()
Returns the default precision for the given datatype
|
TemporalPrecisionEnum |
getPrecision()
Gets the precision for this datatype (using the default for the given type if not set)
|
long |
getTime()
Returns the time in millis as represented by this Date/Time
|
TimeZone |
getTimeZone()
Returns the TimeZone associated with this dateTime's value.
|
boolean |
isTimeZoneZulu() |
boolean |
isToday()
Returns
true if this object represents a date that is today's date |
protected Date |
parse(String theValue)
Subclasses must override to convert an encoded representation of this datatype into a "coerced" one
|
void |
setOffsetMinutes(int theZoneOffsetMinutes)
Sets the TimeZone offset in minutes relative to GMT
|
void |
setPrecision(TemporalPrecisionEnum thePrecision)
Sets the precision for this datatype using field values from
Calendar. |
void |
setTimeZone(TimeZone theTimeZone) |
void |
setTimeZoneZulu(boolean theTimeZoneZulu) |
BaseDateTimeType |
setValue(Date theValue)
Sets the value of this date/time using the default level of precision
for this datatype
using the system local time zone
|
void |
setValue(Date theValue,
TemporalPrecisionEnum thePrecision)
Sets the value of this date/time using the specified level of precision
using the system local time zone
|
void |
setValueAsString(String theValue) |
protected void |
setValueAsV3String(String theV3String) |
Calendar |
toCalendar()
Returns a view of this date/time as a Calendar object
|
String |
toHumanDisplay()
Returns a human readable version of this date/time using the system local format.
|
String |
toHumanDisplayLocalTimezone()
Returns a human readable version of this date/time using the system local format,
converted to the local timezone if neccesary.
|
asStringValue, copy, equalsDeep, equalsShallow, fromStringValue, getValue, getValueAsString, hashCode, hasValue, isEmpty, isPrimitive, primitiveValue, toString, typedCopy, updateStringValueaddChild, addExtension, addExtension, copyValues, fhirType, getExtension, getExtensionsByUrl, getExtensionString, getId, getIdElement, hasExtension, hasExtension, hasId, hasIdElement, listChildren, setId, setIdElement, setPropertycastToAddress, castToAnnotation, castToAttachment, castToBase64Binary, castToBoolean, castToCode, castToCodeableConcept, castToCoding, castToContactPoint, castToDate, castToDateTime, castToDecimal, castToDuration, castToElementDefinition, castToExtension, castToHumanName, castToId, castToIdentifier, castToInstant, castToInteger, castToMarkdown, castToMeta, castToMoney, castToNarrative, castToOid, castToPeriod, castToPositiveInt, castToQuantity, castToRange, castToRatio, castToReference, castToResource, castToSampledData, castToSignature, castToSimpleQuantity, castToString, castToTime, castToTiming, castToUnsignedInt, castToUri, children, compareDeep, compareDeep, compareDeep, compareValues, compareValues, equals, getChildByName, getFormatCommentsPost, getFormatCommentsPre, getUserData, getUserInt, getUserString, hasFormatComment, hasType, hasUserData, isMetadataBased, listChildrenByName, setUserData, setUserDataINNclone, equals, finalize, getClass, notify, notifyAll, wait, wait, waitpublic BaseDateTimeType()
public BaseDateTimeType(Date theDate, TemporalPrecisionEnum thePrecision)
IllegalArgumentException - If the specified precision is not allowed for this typepublic BaseDateTimeType(String theString)
IllegalArgumentException - If the specified precision is not allowed for this typepublic BaseDateTimeType(Date theDate, TemporalPrecisionEnum thePrecision, TimeZone theTimeZone)
protected String encode(Date theValue)
PrimitiveTypeencode in class PrimitiveType<Date>theValue - Will not be nullprotected abstract TemporalPrecisionEnum getDefaultPrecisionForDatatype()
public TemporalPrecisionEnum getPrecision()
setPrecision(TemporalPrecisionEnum)public TimeZone getTimeZone()
null if no timezone was
supplied.public boolean isTimeZoneZulu()
public boolean isToday()
true if this object represents a date that is today's dateNullPointerException - if PrimitiveType.getValue() returns nullprotected Date parse(String theValue) throws IllegalArgumentException
PrimitiveTypeparse in class PrimitiveType<Date>theValue - Will not be nullIllegalArgumentExceptionpublic void setPrecision(TemporalPrecisionEnum thePrecision) throws IllegalArgumentException
Calendar. Valid values are:
IllegalArgumentExceptionpublic void setTimeZone(TimeZone theTimeZone)
public void setTimeZoneZulu(boolean theTimeZoneZulu)
public BaseDateTimeType setValue(Date theValue)
setValue in interface org.hl7.fhir.instance.model.api.IPrimitiveType<Date>setValue in class PrimitiveType<Date>theValue - The date valuepublic void setValue(Date theValue, TemporalPrecisionEnum thePrecision) throws IllegalArgumentException
theValue - The date valuethePrecision - The precisionIllegalArgumentExceptionpublic void setValueAsString(String theValue) throws IllegalArgumentException
setValueAsString in interface org.hl7.fhir.instance.model.api.IPrimitiveType<Date>setValueAsString in class PrimitiveType<Date>IllegalArgumentExceptionpublic boolean before(DateTimeType theDateTimeType)
public boolean after(DateTimeType theDateTimeType)
public String toHumanDisplay()
Note on time zones: This method renders the value using the time zone
that is contained within the value. For example, if this date object contains the
value "2012-01-05T12:00:00-08:00", the human display will be rendered as "12:00:00"
even if the application is being executed on a system in a different time zone. If
this behaviour is not what you want, use toHumanDisplayLocalTimezone()
instead.
public String toHumanDisplayLocalTimezone()
public Calendar toCalendar()
public void setOffsetMinutes(int theZoneOffsetMinutes)
public long getTime()
public void add(int theField, int theValue)
theField - The field, uses constants from Calendar such as Calendar.YEARtheValue - The number to add (or subtract for a negative number)protected void setValueAsV3String(String theV3String)
Copyright © 2014–2018 University Health Network. All rights reserved.