te::dt::DateTimeProperty Class Reference

The type for date and time types: date, date period, date duration, time duration, time instant, time period, time instant with time zone or time period with time zone. More...

#include <DateTimeProperty.h>

Inheritance diagram for te::dt::DateTimeProperty:
te::dt::SimpleProperty te::dt::Property

Public Member Functions

Propertyclone () const
 It returns a clone of the object. More...
 
 DateTimeProperty (const std::string &name, DateTimeType dateType=DATE, bool isRequired=false, std::string *defaultValue=0, unsigned int id=0, Property *parent=0)
 It constructs a new date and time property. More...
 
 DateTimeProperty (const std::string &name, DateTimeType dateType, TemporalResolution tmpRes, bool isRequired=false, std::string *defaultValue=0, unsigned int id=0, Property *parent=0)
 It constructs a new date and time property. More...
 
 DateTimeProperty (const std::string &name, TemporalResolution tmpRes, DateTimeStringFormat strFormat, bool isRequired=false, std::string *defaultValue=0, unsigned int id=0, Property *parent=0)
 It constructs a new date and time property that is represented by string. More...
 
 DateTimeProperty (const std::string &name, TemporalResolution tmpRes, DateTimeOrdinalType ordType, TimeInstant startTime, bool isRequired=false, std::string *defaultValue=0, unsigned int id=0, Property *parent=0)
 It constructs a new date and time property that is represented by ordinal numbers. More...
 
 DateTimeProperty (const DateTimeProperty &rhs)
 Copy constructor. More...
 
const std::string & getDatasetName () const
 It returns the name of the propery's dataset. More...
 
std::string * getDefaultValue () const
 It returns the default value associated to the property, or NULL if none is associated. More...
 
unsigned int getId () const
 It returns the property identifier. More...
 
const std::string & getName () const
 It returns the property name. More...
 
TimeInstant getOrdinalStartTime () const
 It returns the start time associated to the user-defined ordinal date and time. More...
 
DateTimeOrdinalType getOrdinalType () const
 It returns the ordinal type, when the date and time is represented by a ordinal number. More...
 
PropertygetParent () const
 It returns the parent of this property, or NULL, if it doesn't have one. More...
 
TemporalResolution getResolution () const
 It returns the temporal resolution. More...
 
DateTimeStringFormat getStrFormat () const
 It returns the string format. More...
 
DateTimeType getSubType () const
 It returns the date time property sub type. More...
 
int getType () const
 It returns the property data type. More...
 
bool has (Property *p) const
 It checks if the Property "p" is associated to this property or any other parent. More...
 
bool isAutoNumber () const
 It returns true if the attribute is an autonumber, otherwise it returns false. More...
 
bool isRequired () const
 It returns true if the attribute is required, otherwise it returns false. More...
 
DateTimePropertyoperator= (const DateTimeProperty &rhs)
 Assignment operator. More...
 
void setAutoNumber (bool a)
 It tells if the property is an autonumber or not. More...
 
void setDatasetName (const std::string &dsName)
 It sets the property name. More...
 
void setDefaultValue (std::string *d)
 It sets the default value associated to the property, or NULL if none is associated. More...
 
void setId (unsigned int id)
 It sets the property identifier. More...
 
void setName (const std::string &name)
 It sets the property name. More...
 
void setOrdinalStartTime (TimeInstant t)
 It sets the start time associated to the user-defined ordinal date and time. More...
 
void setOrdinalType (DateTimeOrdinalType t)
 It sets the ordinal type. More...
 
void setParent (Property *p)
 It associate this property to the informed parent. More...
 
void setRequired (bool r)
 It tells if the property is required or not. More...
 
void setResolution (TemporalResolution t)
 It sets the temporal resolution. More...
 
void setStrFormat (DateTimeStringFormat f)
 It sets the string format. More...
 
void setSubtype (DateTimeType t)
 It sets the date time property sub type. More...
 
 ~DateTimeProperty ()
 Destructor. More...
 

Protected Attributes

std::string m_datasetName
 The property's dataset name. More...
 
std::string * m_defaultValue
 Default value. More...
 
DateTimeType m_dSubType
 The sub-type of this date time property. More...
 
unsigned int m_id
 An identification number that can be used internally. More...
 
bool m_isAutoNumber
 A flag that indicates if this is an autonumber or serial type. More...
 
bool m_isRequired
 This flag indicates if the attribute is required or not. More...
 
std::string m_name
 The property name. More...
 
TimeInstant m_ordinalStartTime
 The start time when the ordinal type is USER_DEFINED. More...
 
DateTimeOrdinalType m_ordinalType
 The ordinal type when the data type is ORDINAL_TIME. More...
 
Propertym_parent
 The parent property type: it must be a CompositeProperty. More...
 
DateTimeStringFormat m_strFormat
 The string format when the data type is STRING_TIME. More...
 
TemporalResolution m_tempResolution
 The temporal resolution. More...
 
int m_type
 The property data type. More...
 

Detailed Description

The type for date and time types: date, date period, date duration, time duration, time instant, time period, time instant with time zone or time period with time zone.

See also
SimpleProperty, Property, NumericProperty, ArrayProperty, StringProperty, CompositeProperty

Definition at line 47 of file DateTimeProperty.h.

Constructor & Destructor Documentation

te::dt::DateTimeProperty::DateTimeProperty ( const std::string &  name,
DateTimeType  dateType = DATE,
bool  isRequired = false,
std::string *  defaultValue = 0,
unsigned int  id = 0,
Property parent = 0 
)

It constructs a new date and time property.

Parameters
nameThe attribute name.
dateTypeThe date and time subtype.
isRequiredIt indicates if the the property is required (mandatory) or not.
defaultValueThe default value to be used, if none is informed.
idThe property identifier.
parentA reference to the parent Property of the new object if it has one.
Postcondition
The date time property will take the ownership of the defaultValue.
Warning
The identifier value (id) may be used by data source implementations. So, don't rely on its value!
te::dt::DateTimeProperty::DateTimeProperty ( const std::string &  name,
DateTimeType  dateType,
TemporalResolution  tmpRes,
bool  isRequired = false,
std::string *  defaultValue = 0,
unsigned int  id = 0,
Property parent = 0 
)

It constructs a new date and time property.

Parameters
nameThe attribute name.
dateTypeThe date and time subtype.
tmpResThe temporal resolution.
isRequiredIt indicates if the the property is required (mandatory) or not.
defaultValueThe default value to be used, if none is informed.
idThe property identifier.
parentA reference to the parent Property of the new object if it has one.
Postcondition
The date time property will take the ownership of the defaultValue.
Warning
The identifier value (id) may be used by data source implementations. So, don't rely on its value!
te::dt::DateTimeProperty::DateTimeProperty ( const std::string &  name,
TemporalResolution  tmpRes,
DateTimeStringFormat  strFormat,
bool  isRequired = false,
std::string *  defaultValue = 0,
unsigned int  id = 0,
Property parent = 0 
)

It constructs a new date and time property that is represented by string.

Parameters
nameThe attribute name.
tmpResThe temporal resolution.
strFormatThe format of the string that represents a time information
isRequiredIt indicates if the the property is required (mandatory) or not.
defaultValueThe default value to be used, if none is informed.
idThe property identifier.
parentA reference to the parent Property of the new object if it has one.
Postcondition
The date time property will take the ownership of the defaultValue.
Note
This constructor must be used when the data type is STRING_TIME
Warning
The identifier value (id) may be used by data source implementations. So, don't rely on its value!
te::dt::DateTimeProperty::DateTimeProperty ( const std::string &  name,
TemporalResolution  tmpRes,
DateTimeOrdinalType  ordType,
TimeInstant  startTime,
bool  isRequired = false,
std::string *  defaultValue = 0,
unsigned int  id = 0,
Property parent = 0 
)

It constructs a new date and time property that is represented by ordinal numbers.

Parameters
nameThe attribute name.
tmpResThe temporal resolution.
ordTypeThe type of the ordinal time
startTimeThe start time when the ordinal type is USER_DEFINED
isRequiredIt indicates if the the property is required (mandatory) or not.
defaultValueThe default value to be used, if none is informed.
idThe property identifier.
parentA reference to the parent Property of the new object if it has one.
Postcondition
The date time property will take the ownership of the defaultValue.
Note
This constructor must be used when the data type is ORDINAL_TIME
Warning
The identifier value (id) may be used by data source implementations. So, don't rely on its value!
te::dt::DateTimeProperty::DateTimeProperty ( const DateTimeProperty rhs)

Copy constructor.

Parameters
rhsThe right-hand-side copy used to copy from.
te::dt::DateTimeProperty::~DateTimeProperty ( )
inline

Destructor.

Definition at line 155 of file DateTimeProperty.h.

Member Function Documentation

Property* te::dt::DateTimeProperty::clone ( ) const
virtual

It returns a clone of the object.

The new property will NOT have associations to other properties.

Returns
A clone of the object.

Reimplemented from te::dt::SimpleProperty.

const std::string& te::dt::Property::getDatasetName ( ) const
inlineinherited

It returns the name of the propery's dataset.

Returns
The the propery's dataset name.

Definition at line 144 of file Property.h.

std::string* te::dt::SimpleProperty::getDefaultValue ( ) const
inlineinherited

It returns the default value associated to the property, or NULL if none is associated.

Returns
The default value associated to the property, or NULL if none is associated.
Note
The caller of this method will not take the ownership of the given string.

Definition at line 127 of file SimpleProperty.h.

unsigned int te::dt::Property::getId ( ) const
inlineinherited

It returns the property identifier.

Returns
A number used to identify the property.
Warning
The identifier value may be used by data source implementations. So, don't rely on its value!

Definition at line 109 of file Property.h.

const std::string& te::dt::Property::getName ( ) const
inlineinherited

It returns the property name.

Returns
The property name.
Note
For DataSetTypes the name can have namespace prefix or schema name prefix, it will depend on the data source implementation.

Definition at line 127 of file Property.h.

TimeInstant te::dt::DateTimeProperty::getOrdinalStartTime ( ) const
inline

It returns the start time associated to the user-defined ordinal date and time.

Returns
The start time associated to the user-defined ordinal date and time.

Definition at line 227 of file DateTimeProperty.h.

DateTimeOrdinalType te::dt::DateTimeProperty::getOrdinalType ( ) const
inline

It returns the ordinal type, when the date and time is represented by a ordinal number.

Returns
The ordinal type, when the date and time is represented by a ordinal number

Definition at line 213 of file DateTimeProperty.h.

Property* te::dt::Property::getParent ( ) const
inlineinherited

It returns the parent of this property, or NULL, if it doesn't have one.

Returns
The parent of this property, or NULL, if it doesn't have one.

Definition at line 168 of file Property.h.

TemporalResolution te::dt::DateTimeProperty::getResolution ( ) const
inline

It returns the temporal resolution.

Returns
The temporal resolution.

Definition at line 185 of file DateTimeProperty.h.

DateTimeStringFormat te::dt::DateTimeProperty::getStrFormat ( ) const
inline

It returns the string format.

Returns
The format of the string that represents the date and time

Definition at line 199 of file DateTimeProperty.h.

DateTimeType te::dt::DateTimeProperty::getSubType ( ) const
inline

It returns the date time property sub type.

Returns
The string property sub type.

Definition at line 171 of file DateTimeProperty.h.

int te::dt::Property::getType ( ) const
inlineinherited

It returns the property data type.

Returns
The property data type.

Definition at line 161 of file Property.h.

Referenced by te::dt::CompositeProperty::findFirstPropertyOfType().

bool te::dt::SimpleProperty::has ( Property p) const
virtualinherited

It checks if the Property "p" is associated to this property or any other parent.

This method can be used to ask if a given Property belongs to a more complex type (like: CompositeProperty or DataSetType).

Parameters
pThe Property we are checking.
Returns
True if the given Property "p" is associated to to this Property, otherwise, returns false.

Implements te::dt::Property.

bool te::dt::SimpleProperty::isAutoNumber ( ) const
inlineinherited

It returns true if the attribute is an autonumber, otherwise it returns false.

Returns
True if the attribute is an autonumber, otherwise it returns false.

Definition at line 111 of file SimpleProperty.h.

bool te::dt::SimpleProperty::isRequired ( ) const
inlineinherited

It returns true if the attribute is required, otherwise it returns false.

Returns
True if the attribute is required, otherwise it returns false.

Definition at line 97 of file SimpleProperty.h.

DateTimeProperty& te::dt::DateTimeProperty::operator= ( const DateTimeProperty rhs)

Assignment operator.

Parameters
rhsThe right-hand-side copy used to copy from.
Returns
A reference to this object.
void te::dt::SimpleProperty::setAutoNumber ( bool  a)
inlineinherited

It tells if the property is an autonumber or not.

Parameters
aIf true the property is marked as an autonumber (serial), otherwise it is not.

Definition at line 118 of file SimpleProperty.h.

Referenced by te::pgis::Convert2TerraLib().

void te::dt::Property::setDatasetName ( const std::string &  dsName)
inlineinherited

It sets the property name.

Parameters
nameThe new property name.
Warning
Take care when calling this method for a DataSetType associated to a DataSourceCatalog. Prefer using the rename method on the DataSourceCatalog API instead of using this method.

Definition at line 154 of file Property.h.

void te::dt::SimpleProperty::setDefaultValue ( std::string *  d)
inherited

It sets the default value associated to the property, or NULL if none is associated.

Parameters
dThe default value associated to the property, or NULL if none is associated.
Note
The SimpleProperty qill take the ownership of the given string.
void te::dt::Property::setId ( unsigned int  id)
inlineinherited

It sets the property identifier.

Parameters
idA number used to identify the property.
Warning
The identifier value may be used by data source implementations. So, don't rely on its value!

Definition at line 118 of file Property.h.

void te::dt::Property::setName ( const std::string &  name)
inlineinherited

It sets the property name.

Parameters
nameThe new property name.
Warning
Take care when calling this method for a DataSetType associated to a DataSourceCatalog. Prefer using the rename method on the DataSourceCatalog API instead of using this method.

Definition at line 137 of file Property.h.

void te::dt::DateTimeProperty::setOrdinalStartTime ( TimeInstant  t)
inline

It sets the start time associated to the user-defined ordinal date and time.

Parameters
tThe start time associated to the user-defined ordinal date and time.

Definition at line 234 of file DateTimeProperty.h.

void te::dt::DateTimeProperty::setOrdinalType ( DateTimeOrdinalType  t)
inline

It sets the ordinal type.

Parameters
tThe ordinal type, when the date and time is represented by a ordinal number

Definition at line 220 of file DateTimeProperty.h.

void te::dt::Property::setParent ( Property p)
inlineinherited

It associate this property to the informed parent.

Parameters
pTeh parent property.
Warning
Don't use this method without knowing the internal details of its use.

Definition at line 177 of file Property.h.

void te::dt::SimpleProperty::setRequired ( bool  r)
inlineinherited

It tells if the property is required or not.

Parameters
rIf true the property is marked as required, otherwise it is not required.

Definition at line 104 of file SimpleProperty.h.

void te::dt::DateTimeProperty::setResolution ( TemporalResolution  t)
inline

It sets the temporal resolution.

Parameters
rThe temporal resolution.

Definition at line 192 of file DateTimeProperty.h.

void te::dt::DateTimeProperty::setStrFormat ( DateTimeStringFormat  f)
inline

It sets the string format.

Parameters
fThe format of the string that represents the date and time

Definition at line 206 of file DateTimeProperty.h.

void te::dt::DateTimeProperty::setSubtype ( DateTimeType  t)
inline

It sets the date time property sub type.

Parameters
tThe date time property sub type.

Definition at line 178 of file DateTimeProperty.h.

Member Data Documentation

std::string te::dt::Property::m_datasetName
protectedinherited

The property's dataset name.

Definition at line 208 of file Property.h.

std::string* te::dt::SimpleProperty::m_defaultValue
protectedinherited

Default value.

Definition at line 164 of file SimpleProperty.h.

DateTimeType te::dt::DateTimeProperty::m_dSubType
protected

The sub-type of this date time property.

Definition at line 247 of file DateTimeProperty.h.

unsigned int te::dt::Property::m_id
protectedinherited

An identification number that can be used internally.

Definition at line 205 of file Property.h.

bool te::dt::SimpleProperty::m_isAutoNumber
protectedinherited

A flag that indicates if this is an autonumber or serial type.

Definition at line 163 of file SimpleProperty.h.

bool te::dt::SimpleProperty::m_isRequired
protectedinherited

This flag indicates if the attribute is required or not.

Definition at line 162 of file SimpleProperty.h.

std::string te::dt::Property::m_name
protectedinherited

The property name.

Definition at line 207 of file Property.h.

TimeInstant te::dt::DateTimeProperty::m_ordinalStartTime
protected

The start time when the ordinal type is USER_DEFINED.

Definition at line 251 of file DateTimeProperty.h.

DateTimeOrdinalType te::dt::DateTimeProperty::m_ordinalType
protected

The ordinal type when the data type is ORDINAL_TIME.

Definition at line 250 of file DateTimeProperty.h.

Property* te::dt::Property::m_parent
protectedinherited

The parent property type: it must be a CompositeProperty.

Definition at line 204 of file Property.h.

DateTimeStringFormat te::dt::DateTimeProperty::m_strFormat
protected

The string format when the data type is STRING_TIME.

Definition at line 249 of file DateTimeProperty.h.

TemporalResolution te::dt::DateTimeProperty::m_tempResolution
protected

The temporal resolution.

Definition at line 248 of file DateTimeProperty.h.

int te::dt::Property::m_type
protectedinherited

The property data type.

Definition at line 206 of file Property.h.


The documentation for this class was generated from the following file: