public abstract class TSComponentOne extends AbstractPrimitive
Constructor and Description |
---|
TSComponentOne(Message theMessage) |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clears all data from this type
|
int |
getDay()
Returns the day as an integer.
|
float |
getFractSecond()
Returns the fractional second value as a float.
|
int |
getGMTOffset()
Returns the GMT offset value as an integer.
|
int |
getHour()
Returns the hour as an integer.
|
int |
getMinute()
Returns the minute as an integer.
|
int |
getMonth()
Returns the month as an integer.
|
int |
getSecond()
Returns the second as an integer.
|
String |
getValue()
Returns a String representation of the value of this field.
|
Calendar |
getValueAsCalendar()
Return the value as a calendar object
|
Date |
getValueAsDate()
Return the value as a date object
Note: Sets fields using precision up to the second
|
int |
getYear()
Returns the year as an integer.
|
boolean |
isEmpty()
Returns true if this Visitable has actual content
|
void |
setDateMinutePrecision(int yr,
int mnth,
int dy,
int hr,
int min) |
void |
setDatePrecision(int yr,
int mnth,
int dy) |
void |
setDateSecondPrecision(int yr,
int mnth,
int dy,
int hr,
int min,
float sec) |
void |
setOffset(int signedOffset) |
void |
setValue(Calendar theCalendar)
Convenience setter which sets the value using a
Calendar object. |
void |
setValue(Date theDate)
Convenience setter which sets the value using a
Calendar object. |
void |
setValue(String theValue)
Sets the value of this Primitive, first performing validation as specified
by
getMessage().getValidationContext() . |
void |
setValueToMinute(Calendar theCalendar)
Convenience setter which sets the value using a
Calendar object. |
void |
setValueToMinute(Date theDate)
Convenience setter which sets the value using a
Date object. |
void |
setValueToSecond(Calendar theCalendar)
Convenience setter which sets the value using a
Calendar object. |
void |
setValueToSecond(Date theDate)
Convenience setter which sets the value using a
Date object. |
accept, encode, parse, toString
getExtraComponents, getMessage, getName, provideLocation
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getExtraComponents, getMessage, getName
provideLocation
public TSComponentOne(Message theMessage)
theMessage
- message to which this Type belongspublic void setValue(String theValue) throws DataTypeException
AbstractPrimitive
getMessage().getValidationContext()
. No validation is performed
if getMessage() returns null.
Note: as of the next HAPI release, the ValidationContext will be retrieved from getParser().getValidationContext(), which ultimately is the ValidationContext of the active HapiContext.
setValue
in interface Primitive
setValue
in class AbstractPrimitive
theValue
- the value to be setDataTypeException
- if the value is incorrectly formatted and either validation is
enabled for this primitive or detail setters / getters have been called, forcing further
parsing.AbstractPrimitive.setValue(java.lang.String)
public String getValue()
Primitive
getValue
in interface Primitive
getValue
in class AbstractPrimitive
AbstractPrimitive.getValue()
public void setDatePrecision(int yr, int mnth, int dy) throws DataTypeException
DataTypeException
- if the value is incorrectly formatted. If validation is enabled, this
exception should be thrown at setValue(), but if not, detailed parsing may be deferred until
this method is called.CommonTS.setDatePrecision(int, int, int)
public void setDateMinutePrecision(int yr, int mnth, int dy, int hr, int min) throws DataTypeException
DataTypeException
- if the value is incorrectly formatted. If validation is enabled, this
exception should be thrown at setValue(), but if not, detailed parsing may be deferred until
this method is called.CommonTS.setDateMinutePrecision(int, int, int, int, int)
public void setDateSecondPrecision(int yr, int mnth, int dy, int hr, int min, float sec) throws DataTypeException
DataTypeException
- if the value is incorrectly formatted. If validation is enabled, this
exception should be thrown at setValue(), but if not, detailed parsing may be deferred until
this method is called.CommonTS.setDateSecondPrecision(int, int, int, int, int, float)
public void setOffset(int signedOffset) throws DataTypeException
DataTypeException
- if the value is incorrectly formatted. If validation is enabled, this
exception should be thrown at setValue(), but if not, detailed parsing may be deferred until
this method is called.CommonTS.setOffset(int)
public int getYear() throws DataTypeException
DataTypeException
- if the value is incorrectly formatted. If validation is enabled, this
exception should be thrown at setValue(), but if not, detailed parsing may be deferred until
this method is called.public int getMonth() throws DataTypeException
DataTypeException
- if the value is incorrectly formatted. If validation is enabled, this
exception should be thrown at setValue(), but if not, detailed parsing may be deferred until
this method is called.public int getDay() throws DataTypeException
DataTypeException
- if the value is incorrectly formatted. If validation is enabled, this
exception should be thrown at setValue(), but if not, detailed parsing may be deferred until
this method is called.public int getHour() throws DataTypeException
DataTypeException
- if the value is incorrectly formatted. If validation is enabled, this
exception should be thrown at setValue(), but if not, detailed parsing may be deferred until
this method is called.public int getMinute() throws DataTypeException
DataTypeException
- if the value is incorrectly formatted. If validation is enabled, this
exception should be thrown at setValue(), but if not, detailed parsing may be deferred until
this method is called.public int getSecond() throws DataTypeException
DataTypeException
- if the value is incorrectly formatted. If validation is enabled, this
exception should be thrown at setValue(), but if not, detailed parsing may be deferred until
this method is called.public float getFractSecond() throws DataTypeException
DataTypeException
- if the value is incorrectly formatted. If validation is enabled, this
exception should be thrown at setValue(), but if not, detailed parsing may be deferred until
this method is called.public int getGMTOffset() throws DataTypeException
DataTypeException
- if the value is incorrectly formatted. If validation is enabled, this
exception should be thrown at setValue(), but if not, detailed parsing may be deferred until
this method is called.public void setValue(Calendar theCalendar) throws DataTypeException
Calendar
object.
Note: Sets fields using precision up to the millisecond, including timezone offsettheCalendar
- The calendar object from which to retrieve valuesDataTypeException
public void setValue(Date theDate) throws DataTypeException
Calendar
object.
Note: Sets fields using precision up to the millisecond, and sets the timezone offset to
the current system offset
Note: Date is timezone-agnostic, representing always GMT timetheDate
- The date object from which to retrieve valuesDataTypeException
public void setValueToMinute(Calendar theCalendar) throws DataTypeException
Calendar
object.
Note: Sets fields using precision up to the minutetheCalendar
- The calendar object from which to retrieve valuesDataTypeException
public void setValueToMinute(Date theDate) throws DataTypeException
Date
object.
Note: Sets fields using precision up to the minute
Note: Date is timezone-agnostic, representing always GMT timetheDate
- The date object from which to retrieve valuesDataTypeException
public void setValueToSecond(Calendar theCalendar) throws DataTypeException
Calendar
object.
Note: Sets fields using precision up to the secondtheCalendar
- The calendar object from which to retrieve valuesDataTypeException
public void setValueToSecond(Date theDate) throws DataTypeException
Date
object.
Note: Sets fields using precision up to the secondtheDate
- The date object from which to retrieve valuesDataTypeException
public Calendar getValueAsCalendar() throws DataTypeException
DataTypeException
- If the current underlying string representation can not be parsed into a valid date/timepublic Date getValueAsDate() throws DataTypeException
DataTypeException
- If the current underlying string representation can not be parsed into a valid date/timepublic boolean isEmpty() throws HL7Exception
AbstractType
isEmpty
in interface Visitable
isEmpty
in class AbstractPrimitive
HL7Exception
- if an error occurred while determining emptinesspublic void clear()
AbstractPrimitive
clear
in interface Type
clear
in class AbstractPrimitive
Copyright © 2001–2017 University Health Network. All rights reserved.