EspressReport 6.6

quadbase.reportdesigner.lang
Class DateTimeObject

java.lang.Object
  extended by quadbase.reportdesigner.lang.DateTimeObject
All Implemented Interfaces:
IObject, IFunctionConstants

public class DateTimeObject
extends java.lang.Object
implements IObject, IFunctionConstants

This class is used to implement formulas for columns contain data/time data


Field Summary
 
Fields inherited from interface quadbase.util.IFunctionConstants
ABS, ACOS, ADD, ADDTIME, AM_PM, AND, ASIN, ATAN, ATAN2, AVERAGE, B_COL, BOOL, BOOL_FUNC, BOOL_NAME, CALENDAR_CONST, CEIL, COL, COS, COUNT, CURRDATE, CURRDATETIME, CURRTIME, D_COL, DATE, DATE_FUNC, DATE_NAME, DATETIME, DAY_OF_MONTH, DAY_OF_WEEK, DAY_OF_WEEK_IN_MONTH, DAY_OF_YEAR, DAYDIFF, DAYOFWEEK, DECL, DIVIDE, E, EQUALS, ERA, EXP, FACTORIAL, FALSE, FLOOR, GETAMPM, GETERA, GETMONTH, GREATER, GREATEREQUAL, HOUR, HOUR_OF_DAY, ID, IEEEREMAINDER, IFELSE_B, IFELSE_D, IFELSE_N, IFELSE_S, INDEXOF, INSERT, LASTINDEXOF, LESS, LESSEQUAL, LOG, MAX, MAXLENGTH, MEDIAN, MILLISECOND, MIN, MINUTE, MOD, MONTH, MULTIPLY, N_COL, NAND, NEW_DATE_NAME, NEW_NUM_NAME, NEW_STR_NAME, NOR, NOT, NUM, NUM_FUNC, NUM_NAME, OR, OTHER_FUNC_NAME, PAGE, PARAM, PI, POW, PRINTDATE, PRINTDATETIME, PRINTTIME, RANDOM, REPLACE, RINT, ROLLTIME, S_COL, SECOND, SIN, SQRT, STDDEV, STR, STR_FUNC, STR_NAME, STRCAT, STRLEN, SUBSTRING, SUBTRACT, SUMSQUARE, TAN, TD_FUNC_NAME, THIS, TODATE, TODEGREES, TOLOWERCASE, TONUMERIC, TORADIANS, TOSTRING, TOTALPAGES, TOTALSECTIONS, TOUPPERCASE, TRUE, VARIANCE, WEEK_OF_MONTH, WEEK_OF_YEAR, WITHIN, XNOR, XOR, YEAR
 
Constructor Summary
  DateTimeObject(java.util.Date date)
          Creates a new DateTimeObject using specified Date
  DateTimeObject(java.lang.String date)
          Creates a new DateTimeObject using specified String
protected DateTimeObject(java.lang.String formula, int sqlType)
          Creates a new DateTimeObject using specified formula and SQL type
  DateTimeObject(StringObject date)
          Creates a new DateTimeObject using specified StringObject
 
Method Summary
static DateTimeObject add(DateTimeObject date, short calendarField, NumericObject amt)
          Add amt to Calendar Field part of the Date
static StringObject getAmPm(DateTimeObject date)
          Returns AM or PM depending on the time of the DateTimeObject
static DateTimeObject getColumnValue(int colInfoIndex)
          Gets the column value at specified column
static DateTimeObject getColumnValue(int colInfoIndex, int sqlType)
          Gets the column value at specified column
static DateTimeObject getColumnValue(int colInfoIndex, short aggregation)
          Gets the column value at specified column after applying specified aggregation.
static DateTimeObject getColumnValue(int colInfoIndex, short aggregation, int sqlType)
          Gets the column value at specified column after applying specified aggregation.
static DateTimeObject getColumnValue(NumericObject colInfoIndex, int sqlType)
          Gets the column value at specified column
static DateTimeObject getColumnValue(NumericObject colInfoIndex, short aggregation, int sqlType)
          Gets the column value at specified column after applying specified aggregation.
static DateTimeObject getCurrentDate()
          Returns the current date
static DateTimeObject getCurrentDateTime()
          Returns the current date and time
static DateTimeObject getCurrentTime()
          Returns the current time
static NumericObject getDateTime(DateTimeObject date, short calendarField)
          Gets the value of a specified field from the DateTimeObject
static NumericObject getDayDifference(DateTimeObject date1, DateTimeObject date2)
          Returns the difference in number of days between the two DateTimeObjects
static StringObject getDayOfWeek(DateTimeObject date)
          Returns the day of the week
static StringObject getERA(DateTimeObject date)
          Returns the ERA of the DateTimeObject
 java.lang.String getFormula()
          Returns the formula
static StringObject getMonth(DateTimeObject date)
          Returns the month
 int getSQLType()
          Returns the SQL type
static StringObject printDate(DateTimeObject date)
          Prints the date
static StringObject printDate(DateTimeObject date, StringObject pattern)
          Prints the date in the specified format
static StringObject printDateTime(DateTimeObject date)
          Prints the date and time
static StringObject printDateTime(DateTimeObject date, StringObject pattern)
          Prints the date and time in the specified format
static StringObject printTime(DateTimeObject date)
          Prints the time
static StringObject printTime(DateTimeObject date, StringObject pattern)
          Prints the time in the specified format
static DateTimeObject roll(DateTimeObject date, short calendarField, NumericObject amt)
          Rolls amt to the Calendar Field part of Date.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DateTimeObject

public DateTimeObject(java.lang.String date)
Creates a new DateTimeObject using specified String


DateTimeObject

public DateTimeObject(StringObject date)
Creates a new DateTimeObject using specified StringObject


DateTimeObject

public DateTimeObject(java.util.Date date)
Creates a new DateTimeObject using specified Date


DateTimeObject

protected DateTimeObject(java.lang.String formula,
                         int sqlType)
Creates a new DateTimeObject using specified formula and SQL type

Method Detail

getFormula

public java.lang.String getFormula()
Returns the formula

Specified by:
getFormula in interface IObject

getSQLType

public int getSQLType()
Returns the SQL type

Specified by:
getSQLType in interface IObject

getColumnValue

public static DateTimeObject getColumnValue(int colInfoIndex)
Gets the column value at specified column


getColumnValue

public static DateTimeObject getColumnValue(int colInfoIndex,
                                            int sqlType)
Gets the column value at specified column


getColumnValue

public static DateTimeObject getColumnValue(NumericObject colInfoIndex,
                                            int sqlType)
Gets the column value at specified column


getColumnValue

public static DateTimeObject getColumnValue(int colInfoIndex,
                                            short aggregation)
Gets the column value at specified column after applying specified aggregation. List of possible aggregations is in @link quadbase.reportdesigner.util.IAggregateConstants


getColumnValue

public static DateTimeObject getColumnValue(int colInfoIndex,
                                            short aggregation,
                                            int sqlType)
Gets the column value at specified column after applying specified aggregation. List of possible aggregations is in @link quadbase.reportdesigner.util.IAggregateConstants


getColumnValue

public static DateTimeObject getColumnValue(NumericObject colInfoIndex,
                                            short aggregation,
                                            int sqlType)
Gets the column value at specified column after applying specified aggregation. List of possible aggregations is in @link quadbase.reportdesigner.util.IAggregateConstants


getCurrentDateTime

public static DateTimeObject getCurrentDateTime()
Returns the current date and time


getCurrentDate

public static DateTimeObject getCurrentDate()
Returns the current date


getCurrentTime

public static DateTimeObject getCurrentTime()
Returns the current time


add

public static DateTimeObject add(DateTimeObject date,
                                 short calendarField,
                                 NumericObject amt)
Add amt to Calendar Field part of the Date

Calendar Field : quadbase.reportdesigner.util.IFunctionConstants.ERA quadbase.reportdesigner.util.IFunctionConstants.YEAR quadbase.reportdesigner.util.IFunctionConstants.MONTH quadbase.reportdesigner.util.IFunctionConstants.WEEK_OF_YEAR quadbase.reportdesigner.util.IFunctionConstants.WEEK_OF_MONTH quadbase.reportdesigner.util.IFunctionConstants.DATE quadbase.reportdesigner.util.IFunctionConstants.DAY_OF_MONTH quadbase.reportdesigner.util.IFunctionConstants.DAY_OF_YEAR quadbase.reportdesigner.util.IFunctionConstants.DAY_OF_WEEK quadbase.reportdesigner.util.IFunctionConstants.DAY_OF_WEEK_IN_MONTH quadbase.reportdesigner.util.IFunctionConstants.AM_PM quadbase.reportdesigner.util.IFunctionConstants.HOUR quadbase.reportdesigner.util.IFunctionConstants.HOUR_OF_DAY quadbase.reportdesigner.util.IFunctionConstants.MINUTE quadbase.reportdesigner.util.IFunctionConstants.SECOND quadbase.reportdesigner.util.IFunctionConstants.MILLISECOND

See Also:
IFunctionConstants

roll

public static DateTimeObject roll(DateTimeObject date,
                                  short calendarField,
                                  NumericObject amt)
Rolls amt to the Calendar Field part of Date. Note that here except for the Calendar Field of the Date, no other field is affected. In event of an overflow, the field rolls over


getDateTime

public static NumericObject getDateTime(DateTimeObject date,
                                        short calendarField)
Gets the value of a specified field from the DateTimeObject


getDayDifference

public static NumericObject getDayDifference(DateTimeObject date1,
                                             DateTimeObject date2)
Returns the difference in number of days between the two DateTimeObjects


getDayOfWeek

public static StringObject getDayOfWeek(DateTimeObject date)
Returns the day of the week


getMonth

public static StringObject getMonth(DateTimeObject date)
Returns the month


getAmPm

public static StringObject getAmPm(DateTimeObject date)
Returns AM or PM depending on the time of the DateTimeObject


getERA

public static StringObject getERA(DateTimeObject date)
Returns the ERA of the DateTimeObject


printDateTime

public static StringObject printDateTime(DateTimeObject date)
Prints the date and time


printDateTime

public static StringObject printDateTime(DateTimeObject date,
                                         StringObject pattern)
Prints the date and time in the specified format


printTime

public static StringObject printTime(DateTimeObject date)
Prints the time


printTime

public static StringObject printTime(DateTimeObject date,
                                     StringObject pattern)
Prints the time in the specified format


printDate

public static StringObject printDate(DateTimeObject date)
Prints the date


printDate

public static StringObject printDate(DateTimeObject date,
                                     StringObject pattern)
Prints the date in the specified format


EspressReport 6.6