rs.sol.soloist.server.builtindomains.builtindatatypes
Class Date

java.lang.Object
  extended by rs.sol.soloist.server.uml.commonimplementation.runtime._ClassifierInstance
      extended by rs.sol.soloist.server.uml.commonimplementation.runtime._DataTypeInstance
          extended by rs.sol.soloist.server.javaimpl.runtime.SOLoistDataTypeInstance
              extended by rs.sol.soloist.server.builtindomains.builtindatatypes.InstanceOfDataType
                  extended by rs.sol.soloist.server.builtindomains.builtindatatypes.InstanceOfPrimitiveType
                      extended by rs.sol.soloist.server.builtindomains.builtindatatypes.Date
All Implemented Interfaces:
rs.sol.soloist.server.uml.concepts.IElement, IClassifierInstance, IDataTypeInstance, IPrimitiveTypeInstance, IRTElement

public class Date
extends InstanceOfPrimitiveType

Local date (zoneless).


Nested Class Summary
static class Date.AsDate
          Date stored as SQL DATE (in UTC)
static class Date.AsString
          Date stored as string yyyy-MM-dd
static class Date.DefaultSerializationHandler
           
 
Field Summary
static IPrimitiveType CLASSIFIER
           
static java.lang.String FQ_TYPE_NAME
           
static java.lang.String YYYY_MM_DD
           
 
Constructor Summary
Date()
           
Date(int year, int month, int dayOfMonth)
           
Date(int year, int month, int dayOfMonth, int monthOffset)
           
 
Method Summary
 boolean equals(java.lang.Object obj)
           
static Date fromSerializable(java.io.Serializable ser)
           
static Date fromString(java.lang.String string)
           
 int getDayOfMonth()
           
 int getMonth()
           
 java.lang.Object getValue()
           
 int getYear()
           
 int hashCode()
           
 boolean isEqualTo(IClassifierInstance ci)
          Is this Classifier Instance equal to the given Classifier Instance?
Semantic rules:
1.
 IClassifierInstance makeClone()
          Clones this Classifier Instance.
 DateTime midnight()
           
 DateTime midnight(java.util.TimeZone zone)
           
 DateTime noon()
           
 DateTime noon(java.util.TimeZone zone)
           
 void setFieldsOnCalendar(java.util.Calendar cal)
           
 java.util.Date toJavaUtilDate()
           
 java.util.Date toJavaUtilDate(java.util.Calendar cal)
           
 java.sql.Date toSQLDate(java.util.Calendar cal)
           
 java.sql.Date toSQLDate(java.util.TimeZone zone)
           
 java.lang.String toString()
           
 DateTime withTime(Time time)
           
 DateTime withTime(Time time, java.util.TimeZone zone)
           
 
Methods inherited from class rs.sol.soloist.server.builtindomains.builtindatatypes.InstanceOfPrimitiveType
accept, accept, getSQLString, toSerializable
 
Methods inherited from class rs.sol.soloist.server.javaimpl.runtime.SOLoistDataTypeInstance
addAttributeValue, getAttributeValue, getDataType, getMyID, getSlot, getSlots, setDataType, setMyID
 
Methods inherited from class rs.sol.soloist.server.uml.commonimplementation.runtime._DataTypeInstance
getClassifier, hasIdentity, isClassInstance, isDataTypeInstance, isMarkedAsDeleted, markAsDeleted
 
Methods inherited from class rs.sol.soloist.server.uml.commonimplementation.runtime._ClassifierInstance
conformsTo, constructor, copySlots, copySlots, destroy, destructor, getAttributeValue, getAttributeValue, getAttributeValue, getAttributeValues, getClassifierFQName, getClassifierUQName, getFirstCommonGeneralizer, getFirstCommonGeneralizerFQName, getFirstCommonGeneralizerUQName, getMElement, getSlot, getSlot, getSlot, isDirectInstanceOf, isDirectInstanceOf, isInstanceOf, isInstanceOf, isKindOf, isModelElement, isRTElement
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface rs.sol.soloist.server.uml.concepts.runtime.IDataTypeInstance
getDataType
 
Methods inherited from interface rs.sol.soloist.server.uml.concepts.runtime.IClassifierInstance
conformsTo, constructor, copySlots, copySlots, destroy, destructor, getAttributeValue, getAttributeValue, getAttributeValue, getAttributeValues, getClassifier, getClassifierFQName, getClassifierUQName, getFirstCommonGeneralizer, getFirstCommonGeneralizerFQName, getFirstCommonGeneralizerUQName, getMyID, getSlot, getSlot, getSlot, getSlot, getSlots, isClassInstance, isDataTypeInstance, isDirectInstanceOf, isDirectInstanceOf, isInstanceOf, isInstanceOf, isMarkedAsDeleted, markAsDeleted
 
Methods inherited from interface rs.sol.soloist.server.uml.concepts.runtime.IRTElement
getMElement, hasIdentity
 
Methods inherited from interface rs.sol.soloist.server.uml.concepts.IElement
isKindOf, isModelElement, isRTElement
 

Field Detail

FQ_TYPE_NAME

public static final java.lang.String FQ_TYPE_NAME
See Also:
Constant Field Values

CLASSIFIER

public static final IPrimitiveType CLASSIFIER

YYYY_MM_DD

public static final java.lang.String YYYY_MM_DD
See Also:
Constant Field Values
Constructor Detail

Date

public Date()

Date

public Date(int year,
            int month,
            int dayOfMonth)
Parameters:
year -
month - - from 1 to 12
dayOfMonth - - from 1 to 31

Date

public Date(int year,
            int month,
            int dayOfMonth,
            int monthOffset)
Method Detail

toSQLDate

public java.sql.Date toSQLDate(java.util.Calendar cal)

toSQLDate

public java.sql.Date toSQLDate(java.util.TimeZone zone)

setFieldsOnCalendar

public void setFieldsOnCalendar(java.util.Calendar cal)

isEqualTo

public boolean isEqualTo(IClassifierInstance ci)
                  throws rs.sol.soloist.server.uml.exceptions.RequestFailedException
Description copied from interface: IClassifierInstance
Is this Classifier Instance equal to the given Classifier Instance?
Semantic rules:
1. If this and ci are instances of different kinds of Classifiers (one is an instance of a Class, and the other is an instance of a Data Type) they are different (not equal).
2. If this and ci refer to two different instances of Classes, they are different (not equal).
3. If this and ci refer to two instances of Data Types, their equality is checked on value basis (if all of their Slots are equal).

Specified by:
isEqualTo in interface IClassifierInstance
Overrides:
isEqualTo in class rs.sol.soloist.server.javaimpl.runtime.SOLoistDataTypeInstance
Throws:
rs.sol.soloist.server.uml.exceptions.RequestFailedException

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

makeClone

public IClassifierInstance makeClone()
                              throws rs.sol.soloist.server.uml.exceptions.ActionExecutionFailedException
Description copied from interface: IClassifierInstance
Clones this Classifier Instance.

Throws:
rs.sol.soloist.server.uml.exceptions.ActionExecutionFailedException

getYear

public int getYear()

getMonth

public int getMonth()
Returns:
Month - from 1 (January) to 12 (December)

getDayOfMonth

public int getDayOfMonth()

toString

public java.lang.String toString()
Specified by:
toString in interface IDataTypeInstance
Overrides:
toString in class rs.sol.soloist.server.uml.commonimplementation.runtime._ClassifierInstance
Returns:
String in yyyy-MM-dd format

fromString

public static Date fromString(java.lang.String string)
Parameters:
string - - in yyyy-MM-dd format

midnight

public DateTime midnight()
Returns:
DateTime corresponding to the midnight at this Date in local time zone

midnight

public DateTime midnight(java.util.TimeZone zone)
Returns:
DateTime corresponding to the midnight at this Date in given time zone

noon

public DateTime noon()
Returns:
DateTime corresponding to the noon at this Date in local time zone

noon

public DateTime noon(java.util.TimeZone zone)
Returns:
DateTime corresponding to the noon at this Date in given time zone

withTime

public DateTime withTime(Time time)
Returns:
DateTime corresponding to the given time at this Date in local time zone

withTime

public DateTime withTime(Time time,
                         java.util.TimeZone zone)
Returns:
DateTime corresponding to the given Time at this Date in given time zone

getValue

public java.lang.Object getValue()
Specified by:
getValue in interface IPrimitiveTypeInstance
Overrides:
getValue in class InstanceOfPrimitiveType

fromSerializable

public static Date fromSerializable(java.io.Serializable ser)

toJavaUtilDate

public java.util.Date toJavaUtilDate()

toJavaUtilDate

public java.util.Date toJavaUtilDate(java.util.Calendar cal)