com.edustructures.sifworks.common
Class PartialDateType

java.lang.Object
  extended by com.edustructures.sifworks.Element
      extended by com.edustructures.sifworks.SIFElement
          extended by com.edustructures.sifworks.SIFKeyedElement
              extended by com.edustructures.sifworks.common.PartialDateType
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class PartialDateType
extends SIFKeyedElement

A Date, with an optional month/day, or an optional month by itself.

Since:
2.0
Version:
2.0
See Also:
Serialized Form

Nested Class Summary
static class PartialDateType.DataType
          The set of Data types supported by PartialDateType
 
Field Summary
 
Fields inherited from class com.edustructures.sifworks.Element
CURRENT_SERIALIZE_VERSION
 
Constructor Summary
PartialDateType()
          Constructor
PartialDateType(java.util.Calendar date)
          Constructor that accepts values for all mandatory fields
PartialDateType(java.lang.Integer year)
          Create a PartialDateType representing the given year
PartialDateType(java.lang.Integer year, java.lang.Integer month)
          Create a PartialDateType representing the given year and month
PartialDateType(java.lang.Integer year, java.lang.Integer month, java.lang.Integer day)
          Create a PartialDateType representing the given year, month and date
PartialDateType(java.lang.String value)
          Constructor that accepts values for all mandatory fields
 
Method Summary
 PartialDateType.DataType getDataType()
           
 java.util.Calendar getDate()
          Returns a Calendar instance with its Year, Month and Day fields set to the values of this partial date type
 java.lang.Integer getDay()
          returns the Day component of this partial date
 java.lang.String getKey()
          Gets the key of this object
 ElementDef[] getKeyFields()
          Gets the metadata fields that make up the key of this object
 java.lang.Integer getMonth()
          returns the Month component of this partial date
 java.lang.String getValue()
          Gets the value of the <Value> element.
 java.lang.Integer getYear()
          returns the Year component of this partial date
 void setDate(java.util.Calendar date)
           
 void setDate(java.lang.Integer year, java.lang.Integer month)
          Sets the integral year and month components
 void setDate(java.lang.Integer year, java.lang.Integer month, java.lang.Integer day)
          Sets the integral components of this partial date instance
 void setDay(java.lang.Integer day)
          Sets the Day component of this partial date
 SimpleField setField(ElementDef id, SIFSimpleType value)
          Sets a field's value
 void setField(SimpleField field)
          Sets the value of an attribute or simple text element on this SIFElement
 void setMonth(java.lang.Integer month)
          Sets the Month component of this partial date
 void setTextValue(java.lang.String value)
          Sets the text value of this element if applicable.
 void setValue(java.lang.String value)
          Sets the value of the <Value> element.
 void setYear(java.lang.Integer year)
          Sets the Year component of this partial date
 
Methods inherited from class com.edustructures.sifworks.SIFElement
addChild, addChild, clone, compareGraphTo, create, effectiveSIFVersion, getChild, getChild, getChild, getChild, getChild, getChildCount, getChildList, getChildList, getChildList, getChildren, getChildren, getContent, getContent, getField, getField, getFieldCount, getFields, getFieldValue, getSIFValue, getSIFVersion, getTextValue, getXmlId, hasTextValue, removeChild, removeChild, removeChild, removeChild, restoreImplementationDef, setChanged, setChildren, setEmpty, setField, setField, setSIFValue, setSIFVersion, setXmlId, tag
 
Methods inherited from class com.edustructures.sifworks.Element
compareTo, getElementDef, getParent, getRoot, isChanged, isDoNotEncode, isEmpty, setChanged, setDoNotEncode, setElementDef, setEmpty, setParent, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PartialDateType

public PartialDateType()
Constructor


PartialDateType

public PartialDateType(java.lang.String value)
Constructor that accepts values for all mandatory fields

Parameters:
value - Gets or sets the content value of the <PartialDateType> element

PartialDateType

public PartialDateType(java.util.Calendar date)
Constructor that accepts values for all mandatory fields

Parameters:
date - The Calendar object representing the date

PartialDateType

public PartialDateType(java.lang.Integer year)
Create a PartialDateType representing the given year

Parameters:
year - Year (CCYY).
month - Month (MM)

PartialDateType

public PartialDateType(java.lang.Integer year,
                       java.lang.Integer month)
Create a PartialDateType representing the given year and month

Parameters:
year - Year (CCYY).
month - Month (MM)

PartialDateType

public PartialDateType(java.lang.Integer year,
                       java.lang.Integer month,
                       java.lang.Integer day)
Create a PartialDateType representing the given year, month and date

Parameters:
year - Year (CCYY).
month - Month (MM)
day - Day (DD)
Method Detail

getKey

public java.lang.String getKey()
Gets the key of this object

Overrides:
getKey in class SIFElement
Returns:
The value of the object's Mandatory or Required attribute. If an object has more than one such attribute, the key is a period- delimited concatenation of the attribute values in sequential order

getKeyFields

public ElementDef[] getKeyFields()
Gets the metadata fields that make up the key of this object

Returns:
an array of metadata fields that make up the object's key

getValue

public java.lang.String getValue()
Gets the value of the <Value> element.

The SIF specification defines the meaning of this element as: "Gets or sets the content value of the <PartialDateType> element"

Returns:
The Value element of this object.
Since:
2.0

setValue

public void setValue(java.lang.String value)
Sets the value of the <Value> element.

The SIF specification defines the meaning of this element as: "Gets or sets the content value of the <PartialDateType> element"

Parameters:
value - A String object
Since:
2.0

setYear

public void setYear(java.lang.Integer year)
Sets the Year component of this partial date

Parameters:
year -

getYear

public java.lang.Integer getYear()
returns the Year component of this partial date

Returns:
the year component, or null if not set

setMonth

public void setMonth(java.lang.Integer month)
Sets the Month component of this partial date

Parameters:
month -

getMonth

public java.lang.Integer getMonth()
returns the Month component of this partial date

Returns:
The month (1-12), or null if not set

setDay

public void setDay(java.lang.Integer day)
Sets the Day component of this partial date

Parameters:
day -

getDay

public java.lang.Integer getDay()
returns the Day component of this partial date

Returns:
The day or null if not set

setDate

public void setDate(java.util.Calendar date)

getDate

public java.util.Calendar getDate()
Returns a Calendar instance with its Year, Month and Day fields set to the values of this partial date type

Returns:

setDate

public void setDate(java.lang.Integer year,
                    java.lang.Integer month,
                    java.lang.Integer day)
Sets the integral components of this partial date instance

Parameters:
year -
month -
day -

setDate

public void setDate(java.lang.Integer year,
                    java.lang.Integer month)
Sets the integral year and month components

Parameters:
year -
month -
day -

setField

public SimpleField setField(ElementDef id,
                            SIFSimpleType value)
Description copied from class: SIFElement
Sets a field's value

Overrides:
setField in class SIFElement
Parameters:
id - The field definition object
value - The value to assign to the field
Returns:
The internal field object, returned as a convenience so the caller can mark the field as dirty or empty by calling its setDirty and setEmpty methods.

setField

public void setField(SimpleField field)
Description copied from class: SIFElement
Sets the value of an attribute or simple text element on this SIFElement

Overrides:
setField in class SIFElement

setTextValue

public void setTextValue(java.lang.String value)
Description copied from class: SIFElement
Sets the text value of this element if applicable. The text value will be parsed into the native datatype of the the element.

The formatter used for parsing by default is the SIF 1.x formatter, which means this value must be able to be parsed using SIF 1.x formatting rules. To change the format used for Text values on elements, set the ADK.setTextFormatter(SIFFormatter) property

Overrides:
setTextValue in class SIFElement
Parameters:
value - The text value of this element (e.g. <element>text<element>)

getDataType

public PartialDateType.DataType getDataType()


Copyright © 2001-2007 Edustructures LLC. All Rights Reserved. SIFWorks® and ADK® are registered trademarks of Edustructures LLC. SIF™ and Schools Interoperability Framework are trademarks of the Schools Interoperability Framework Association.