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

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.Time
All Implemented Interfaces:
rs.sol.soloist.server.uml.concepts.IElement, IClassifierInstance, IDataTypeInstance, IPrimitiveTypeInstance, IRTElement

public class Time
extends InstanceOfPrimitiveType

Local time (zoneless).


Nested Class Summary
static class Time.AsString
          Time stored as string HH-mm-ss.SSS
static class Time.AsTime
          Time stored as SQL TIME
static class Time.DefaultSerializationHandler
           
 
Field Summary
static IPrimitiveType CLASSIFIER
           
static java.lang.String FQ_TYPE_NAME
           
static int HOURS_PER_DAY
           
static Time MIDNIGHT
           
static java.lang.String MILLISECOND_RESOLUTION_PATTERN
           
static int MILLISECONDS_PER_DAY
           
static int MILLISECONDS_PER_HOUR
           
static int MILLISECONDS_PER_MINUTE
           
static int MILLISECONDS_PER_SECOND
           
static int MINUTES_PER_HOUR
           
static Time NOON
           
static java.lang.String SECOND_RESOLUTION_PATTERN
           
static int SECONDS_PER_MINUTE
           
 
Constructor Summary
Time()
           
Time(int millisecondsSinceMidnight)
           
Time(int hourOfDay, int minutes)
           
Time(int hourOfDay, int minutes, int seconds)
           
Time(int hourOfDay, int minutes, int seconds, int milliseconds)
           
 
Method Summary
 boolean equals(java.lang.Object obj)
           
static Time fromSerializable(java.io.Serializable ser)
           
static Time fromString(java.lang.String string)
           
 int getHourOfDay()
           
 int getMilliseconds()
           
 int getMillisecondsSinceMidnight()
           
 int getMinutes()
           
 int getSeconds()
           
 java.lang.Object getValue()
           
 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.
 TimeInterval minus(Time other)
           
 Time minus(TimeInterval interval)
           
 Time plus(TimeInterval interval)
           
 void setFieldsOnCalendar(java.util.Calendar cal)
           
 java.io.Serializable toSerializable()
           
 java.sql.Time toSQLTime(java.util.Calendar cal)
           
 java.sql.Time toSQLTime(java.util.TimeZone zone)
           
 java.lang.String toString()
           
 DateTime withDate(Date date)
           
 DateTime withDate(Date date, java.util.TimeZone zone)
           
 
Methods inherited from class rs.sol.soloist.server.builtindomains.builtindatatypes.InstanceOfPrimitiveType
accept, accept, getSQLString
 
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

MILLISECOND_RESOLUTION_PATTERN

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

SECOND_RESOLUTION_PATTERN

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

MILLISECONDS_PER_SECOND

public static final int MILLISECONDS_PER_SECOND
See Also:
Constant Field Values

SECONDS_PER_MINUTE

public static final int SECONDS_PER_MINUTE
See Also:
Constant Field Values

MINUTES_PER_HOUR

public static final int MINUTES_PER_HOUR
See Also:
Constant Field Values

HOURS_PER_DAY

public static final int HOURS_PER_DAY
See Also:
Constant Field Values

MILLISECONDS_PER_MINUTE

public static final int MILLISECONDS_PER_MINUTE
See Also:
Constant Field Values

MILLISECONDS_PER_HOUR

public static final int MILLISECONDS_PER_HOUR
See Also:
Constant Field Values

MILLISECONDS_PER_DAY

public static final int MILLISECONDS_PER_DAY
See Also:
Constant Field Values

MIDNIGHT

public static final Time MIDNIGHT

NOON

public static final Time NOON
Constructor Detail

Time

public Time()

Time

public Time(int millisecondsSinceMidnight)

Time

public Time(int hourOfDay,
            int minutes,
            int seconds,
            int milliseconds)

Time

public Time(int hourOfDay,
            int minutes,
            int seconds)

Time

public Time(int hourOfDay,
            int minutes)
Method Detail

setFieldsOnCalendar

public void setFieldsOnCalendar(java.util.Calendar cal)

toSQLTime

public java.sql.Time toSQLTime(java.util.Calendar cal)

toSQLTime

public java.sql.Time toSQLTime(java.util.TimeZone zone)

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

getHourOfDay

public int getHourOfDay()
Returns:
Hour: 0 to 23

getMinutes

public int getMinutes()
Returns:
Minutes: 0 to 59

getSeconds

public int getSeconds()
Returns:
Seconds: 0 to 59

getMilliseconds

public int getMilliseconds()
Returns:
Milliseconds: 0 to 999

getMillisecondsSinceMidnight

public int getMillisecondsSinceMidnight()
Returns:
Number of milliseconds since midnight (0 to 86399999)

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:
HH:mm:ss.SSS

fromString

public static Time fromString(java.lang.String string)
Parameters:
string - - HH:mm:ss.SSS or HH:mm:ss

withDate

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

withDate

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

plus

public Time plus(TimeInterval interval)

minus

public Time minus(TimeInterval interval)

minus

public TimeInterval minus(Time other)

getValue

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

toSerializable

public java.io.Serializable toSerializable()
Specified by:
toSerializable in interface IDataTypeInstance
Overrides:
toSerializable in class InstanceOfPrimitiveType

fromSerializable

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