Tea Java Runtime API
Version 3.2.5

com.pdmfc.tea.modules.util
Class SDate

java.lang.Object
  extended by com.pdmfc.tea.modules.tos.STosObj
      extended by com.pdmfc.tea.modules.util.SDate
All Implemented Interfaces:
SObjFunction

public class SDate
extends STosObj

Implements an TOS object that represents an instant in time.


Field Summary
 java.util.Calendar _calendar
           
 
Constructor Summary
SDate(STosClass myClass)
          Initializes the object internal state.
 
Method Summary
 java.lang.Object after(SObjFunction obj, SContext context, java.lang.Object[] args)
          The implementation for the "after" TOS method.
 java.lang.Object before(SObjFunction obj, SContext context, java.lang.Object[] args)
          The implementation for the "before" TOS method.
 java.lang.Object compare(SObjFunction obj, SContext context, java.lang.Object[] args)
          The implementation for the "compare" TOS method.
 java.lang.Object constructor(SObjFunction obj, SContext context, java.lang.Object[] args)
          The implementation for the "constructor" TOS method.
 java.lang.Object format(SObjFunction obj, SContext context, java.lang.Object[] args)
          The implementation for the "format" TOS method.
 java.util.Date getDate()
          Fetches the java.util.Date represented by this TOS instance.
static SDate getDate(java.lang.Object[] args, int index)
          This is an utility method.
 java.lang.Object getDay(SObjFunction obj, SContext context, java.lang.Object[] args)
          The implementation for the "getDay" TOS method.
 java.lang.Object getDayOfWeek(SObjFunction obj, SContext context, java.lang.Object[] args)
          The implementation for the "getDayOfWeek" TOS method.
 java.lang.Object getHour(SObjFunction obj, SContext context, java.lang.Object[] args)
          The implementation for the "getHour" TOS method.
 java.lang.Object getMinute(SObjFunction obj, SContext context, java.lang.Object[] args)
          The implementation for the "getMinute" TOS method.
 java.lang.Object getMonth(SObjFunction obj, SContext context, java.lang.Object[] args)
          The implementation for the "getMonth" TOS method.
 java.lang.Object getSecond(SObjFunction obj, SContext context, java.lang.Object[] args)
          The implementation for the "getSecond" TOS method.
static java.lang.String getTosClassName()
           
 java.lang.Object getYear(SObjFunction obj, SContext context, java.lang.Object[] args)
          The implementation for the "getYear" TOS method.
 void initFromDate(java.util.Date date)
          Changes the calendar date this object represents.
 void initFromDate(SDate aDate)
          Initializes the object to represent the same date/time of another SDate.
 void initFromString(java.lang.String str)
          Initializes the object with the date represented by the string argument.
static SDate newInstance(SContext context)
           
 java.lang.Object notSame(SObjFunction obj, SContext context, java.lang.Object[] args)
          The implementation for the "notSame" TOS method.
 java.lang.Object same(SObjFunction obj, SContext context, java.lang.Object[] args)
          The implementation for the "same" TOS method.
 java.lang.Object setDate(SObjFunction obj, SContext context, java.lang.Object[] args)
          The implementation for the "setDay" TOS method.
 java.lang.Object setTime(SObjFunction obj, SContext context, java.lang.Object[] args)
          The implementation for the "setTime TOS method.
 
Methods inherited from class com.pdmfc.tea.modules.tos.STosObj
exec, getTosClass, init, part, selfObj
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_calendar

public final java.util.Calendar _calendar
Constructor Detail

SDate

public SDate(STosClass myClass)
      throws STeaException
Initializes the object internal state.

Throws:
STeaException
Method Detail

initFromDate

public void initFromDate(SDate aDate)
Initializes the object to represent the same date/time of another SDate.

Parameters:
aDate - The SDate object used as source.

initFromString

public void initFromString(java.lang.String str)
                    throws SRuntimeException
Initializes the object with the date represented by the string argument. The string can only have size 6, 8, 12 or 14, otherwise a SRuntimeException is thrown.

Throws:
SRuntimeException - When the string does not have size 6, 8, 12 or 14, or one of the string components does not represent a valid integer.

initFromDate

public void initFromDate(java.util.Date date)
Changes the calendar date this object represents.

Parameters:
date - The new date this object will represent.

getDate

public java.util.Date getDate()
Fetches the java.util.Date represented by this TOS instance.

Returns:
The java.util.Date object represented by this TOS TDate instance.

constructor

public java.lang.Object constructor(SObjFunction obj,
                                    SContext context,
                                    java.lang.Object[] args)
                             throws SRuntimeException
The implementation for the "constructor" TOS method.

Parameters:
obj - Reference to the object the TOS method was invoked for.
context - The context where the method invocation is taking place.
args - The arguments the TOS method was called with.
Throws:
SRuntimeException

getYear

public java.lang.Object getYear(SObjFunction obj,
                                SContext context,
                                java.lang.Object[] args)
The implementation for the "getYear" TOS method.

Parameters:
obj - Reference to the object the TOS method was invoked for.
context - The context where the method invocation is taking place.
args - The arguments the TOS method was called with.

getMonth

public java.lang.Object getMonth(SObjFunction obj,
                                 SContext context,
                                 java.lang.Object[] args)
The implementation for the "getMonth" TOS method.

Parameters:
obj - Reference to the object the TOS method was invoked for.
context - The context where the method invocation is taking place.
args - The arguments the TOS method was called with.

getDay

public java.lang.Object getDay(SObjFunction obj,
                               SContext context,
                               java.lang.Object[] args)
The implementation for the "getDay" TOS method.

Parameters:
obj - Reference to the object the TOS method was invoked for.
context - The context where the method invocation is taking place.
args - The arguments the TOS method was called with.

getHour

public java.lang.Object getHour(SObjFunction obj,
                                SContext context,
                                java.lang.Object[] args)
The implementation for the "getHour" TOS method.

Parameters:
obj - Reference to the object the TOS method was invoked for.
context - The context where the method invocation is taking place.
args - The arguments the TOS method was called with.

getMinute

public java.lang.Object getMinute(SObjFunction obj,
                                  SContext context,
                                  java.lang.Object[] args)
The implementation for the "getMinute" TOS method.

Parameters:
obj - Reference to the object the TOS method was invoked for.
context - The context where the method invocation is taking place.
args - The arguments the TOS method was called with.

getSecond

public java.lang.Object getSecond(SObjFunction obj,
                                  SContext context,
                                  java.lang.Object[] args)
The implementation for the "getSecond" TOS method.

Parameters:
obj - Reference to the object the TOS method was invoked for.
context - The context where the method invocation is taking place.
args - The arguments the TOS method was called with.

getDayOfWeek

public java.lang.Object getDayOfWeek(SObjFunction obj,
                                     SContext context,
                                     java.lang.Object[] args)
The implementation for the "getDayOfWeek" TOS method.

Parameters:
obj - Reference to the object the TOS method was invoked for.
context - The context where the method invocation is taking place.
args - The arguments the TOS method was called with.

setDate

public java.lang.Object setDate(SObjFunction obj,
                                SContext context,
                                java.lang.Object[] args)
                         throws SRuntimeException
The implementation for the "setDay" TOS method.

Parameters:
obj - Reference to the object the TOS method was invoked for.
context - The context where the method invocation is taking place.
args - The arguments the TOS method was called with.
Throws:
SRuntimeException

setTime

public java.lang.Object setTime(SObjFunction obj,
                                SContext context,
                                java.lang.Object[] args)
                         throws SRuntimeException
The implementation for the "setTime TOS method.

Parameters:
obj - Reference to the object the TOS method was invoked for.
context - The context where the method invocation is taking place.
args - The arguments the TOS method was called with.
Throws:
SRuntimeException

format

public java.lang.Object format(SObjFunction obj,
                               SContext context,
                               java.lang.Object[] args)
                        throws SRuntimeException
The implementation for the "format" TOS method.

Parameters:
obj - Reference to the object the TOS method was invoked for.
context - The context where the method invocation is taking place.
args - The arguments the TOS method was called with.
Throws:
SRuntimeException

compare

public java.lang.Object compare(SObjFunction obj,
                                SContext context,
                                java.lang.Object[] args)
                         throws STeaException
The implementation for the "compare" TOS method.

Parameters:
obj - Reference to the object the TOS method was invoked for.
context - The context where the method invocation is taking place.
args - The arguments the TOS method was called with.
Throws:
STeaException

before

public java.lang.Object before(SObjFunction obj,
                               SContext context,
                               java.lang.Object[] args)
                        throws STeaException
The implementation for the "before" TOS method.

Parameters:
obj - Reference to the object the TOS method was invoked for.
context - The context where the method invocation is taking place.
args - The arguments the TOS method was called with.
Throws:
STeaException

after

public java.lang.Object after(SObjFunction obj,
                              SContext context,
                              java.lang.Object[] args)
                       throws STeaException
The implementation for the "after" TOS method.

Parameters:
obj - Reference to the object the TOS method was invoked for.
context - The context where the method invocation is taking place.
args - The arguments the TOS method was called with.
Throws:
STeaException

same

public java.lang.Object same(SObjFunction obj,
                             SContext context,
                             java.lang.Object[] args)
                      throws STeaException
The implementation for the "same" TOS method.

Parameters:
obj - Reference to the object the TOS method was invoked for.
context - The context where the method invocation is taking place.
args - The arguments the TOS method was called with.
Throws:
STeaException

notSame

public java.lang.Object notSame(SObjFunction obj,
                                SContext context,
                                java.lang.Object[] args)
                         throws STeaException
The implementation for the "notSame" TOS method.

Parameters:
obj - Reference to the object the TOS method was invoked for.
context - The context where the method invocation is taking place.
args - The arguments the TOS method was called with.
Throws:
STeaException

getDate

public static SDate getDate(java.lang.Object[] args,
                            int index)
                     throws STeaException
This is an utility method. It tries to convert argument index into a SDate.

Parameters:
args - Array of Object, supposed to be the arguments received by a call to the Tea function.
index - The index of the argument to convert.
Throws:
STypeException - Thrown if args[index] is not a SDate
STeaException

getTosClassName

public static java.lang.String getTosClassName()

newInstance

public static SDate newInstance(SContext context)
                         throws STeaException
Throws:
STeaException

Tea Java Runtime API
Version 3.2.5

© 2009 PDM&FC, All Rights Reserved.