brahms.base.util
Class BrahmsCalendar

java.lang.Object
  extended by brahms.base.util.BrahmsCalendar

public class BrahmsCalendar
extends java.lang.Object

The BrahmsCalendar class manages a set of class attributes to increase performance in the use of the Brahms Calendar class with the related external activities.

Version:
6 November 2003
Author:
Ron van Hoof

Field Summary
static java.lang.String[] ATTRIBUTE_NAMES
           
static int DATE
           
static int DAY_OF_MONTH
           
static int DAY_OF_WEEK
           
static java.text.SimpleDateFormat DAY_OF_WEEK_FORMAT
           
static int DAY_OF_WEEK_IN_MONTH
           
static int HOUR
           
static int MILLISECOND
           
static int MINUTE
           
static int MONTH
           
static java.text.SimpleDateFormat MONTH_FORMAT
           
static int NUM_ATTRIBUTES
           
static int S_DAY_OF_WEEK
           
static int S_MONTH
           
static int SECOND
           
static int TIME_STAMP
           
static java.text.SimpleDateFormat TIME_STAMP_FORMAT
           
static java.text.SimpleDateFormat TIME_STAMP_FORMAT_NO_TZ
           
static int TIME_ZONE
           
static int TIME_ZONE_SHORT
           
static int TIMEMS
           
static int WEEK_OF_MONTH
           
static int WEEK_OF_YEAR
           
static int YEAR
           
 
Constructor Summary
BrahmsCalendar()
           
 
Method Summary
static java.lang.String createTimeStamp(java.util.GregorianCalendar calendar)
          Creates a new timestamp from the specified calendar formatted as MM/dd/yyyy HH:mm:ss zzzz
static IAttribute getAttribute(int attribute)
          Returns the specified Calendar attribute.
static IObject getBrahmsCalendar(java.util.GregorianCalendar calendar, IObject brahmsCalendar, IContext ctx)
          Converts a Java GregorianCalendar into a Brahms Calendar.
static IClass getCalendarClass()
          Returns the Brahms Calendar class.
static java.util.GregorianCalendar getJavaCalendar(IObject calendar, IContext ctx)
          Converts a Brahms Calendar into a Java GregorianCalendar.
static void init()
          Initializes the class attributes.
static java.util.GregorianCalendar parseTimeStamp(java.lang.String timeStamp)
          Parses the specified timestamp into a GregorianCalendar.
static void reset()
          Resets the static variables maintained by this class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NUM_ATTRIBUTES

public static final int NUM_ATTRIBUTES
See Also:
Constant Field Values

DATE

public static final int DATE
See Also:
Constant Field Values

MONTH

public static final int MONTH
See Also:
Constant Field Values

YEAR

public static final int YEAR
See Also:
Constant Field Values

HOUR

public static final int HOUR
See Also:
Constant Field Values

MINUTE

public static final int MINUTE
See Also:
Constant Field Values

SECOND

public static final int SECOND
See Also:
Constant Field Values

MILLISECOND

public static final int MILLISECOND
See Also:
Constant Field Values

DAY_OF_WEEK

public static final int DAY_OF_WEEK
See Also:
Constant Field Values

DAY_OF_MONTH

public static final int DAY_OF_MONTH
See Also:
Constant Field Values

DAY_OF_WEEK_IN_MONTH

public static final int DAY_OF_WEEK_IN_MONTH
See Also:
Constant Field Values

WEEK_OF_MONTH

public static final int WEEK_OF_MONTH
See Also:
Constant Field Values

WEEK_OF_YEAR

public static final int WEEK_OF_YEAR
See Also:
Constant Field Values

TIME_ZONE

public static final int TIME_ZONE
See Also:
Constant Field Values

TIME_ZONE_SHORT

public static final int TIME_ZONE_SHORT
See Also:
Constant Field Values

S_MONTH

public static final int S_MONTH
See Also:
Constant Field Values

S_DAY_OF_WEEK

public static final int S_DAY_OF_WEEK
See Also:
Constant Field Values

TIME_STAMP

public static final int TIME_STAMP
See Also:
Constant Field Values

TIMEMS

public static final int TIMEMS
See Also:
Constant Field Values

ATTRIBUTE_NAMES

public static final java.lang.String[] ATTRIBUTE_NAMES

TIME_STAMP_FORMAT

public static final java.text.SimpleDateFormat TIME_STAMP_FORMAT

TIME_STAMP_FORMAT_NO_TZ

public static final java.text.SimpleDateFormat TIME_STAMP_FORMAT_NO_TZ

MONTH_FORMAT

public static final java.text.SimpleDateFormat MONTH_FORMAT

DAY_OF_WEEK_FORMAT

public static final java.text.SimpleDateFormat DAY_OF_WEEK_FORMAT
Constructor Detail

BrahmsCalendar

public BrahmsCalendar()
Method Detail

init

public static final void init()
                       throws ExternalException
Initializes the class attributes.

Throws:
ExternalException - if an error occurs during the initialization

reset

public static final void reset()
Resets the static variables maintained by this class.


getCalendarClass

public static final IClass getCalendarClass()
                                     throws ExternalException
Returns the Brahms Calendar class.

Returns:
IClass the Brahms Calendar class.
Throws:
ExternalException - if the class could not be found or retrieved.

getAttribute

public static final IAttribute getAttribute(int attribute)
Returns the specified Calendar attribute.

Parameters:
attribute - the constant indicating the desired attribute
Returns:
IAttribute the requested Calendar attribute

createTimeStamp

public static final java.lang.String createTimeStamp(java.util.GregorianCalendar calendar)
Creates a new timestamp from the specified calendar formatted as MM/dd/yyyy HH:mm:ss zzzz

Parameters:
calendar - the GregorianCalendar to be converted to a timestamp
Returns:
String the timestamp

parseTimeStamp

public static final java.util.GregorianCalendar parseTimeStamp(java.lang.String timeStamp)
                                                        throws ExternalException
Parses the specified timestamp into a GregorianCalendar. The timestamp must be formatted as: MM/dd/yyyy HH:mm:ss zzzz

Parameters:
timeStamp - the timeStamp to be parsed
Returns:
GregorianCalendar the parsed time stamp
Throws:
ExternalException - if the timestamp can't be parsed

getJavaCalendar

public static final java.util.GregorianCalendar getJavaCalendar(IObject calendar,
                                                                IContext ctx)
                                                         throws ExternalException
Converts a Brahms Calendar into a Java GregorianCalendar.

Parameters:
calendar - the Brahms Calendar to be converted
ctx - the IContext to be used to access Brahms object information
Returns:
GregorianCalendar the converted calendar
Throws:
ExternalException - if an error occurs during the conversion

getBrahmsCalendar

public static final IObject getBrahmsCalendar(java.util.GregorianCalendar calendar,
                                              IObject brahmsCalendar,
                                              IContext ctx)
                                       throws ExternalException
Converts a Java GregorianCalendar into a Brahms Calendar.

Parameters:
calendar - the Java Calendar to be converted
brahmsCalendar - the Brahms Calendar to store the information into, null if a new one is to be created
ctx - the IContext to be used to add Brahms object information
Returns:
IObject a new converted calendar if brahmsCalendar was null, otherwise brahmsCalendar containing the new information
Throws:
ExternalException - if an error occurs during the conversion


Copyright © 1997-2012 All Rights Reserved.