Style Intelligence v12.0

inetsoft.uql.asset
Class DateRangeRef

java.lang.Object
  extended by inetsoft.uql.erm.AbstractDataRef
      extended by inetsoft.uql.erm.ExpressionRef
          extended by inetsoft.uql.asset.DateRangeRef
All Implemented Interfaces:
AssetObject, SQLExpressionRef, DataRef, DataRefWrapper, RangeRef, XConstants, inetsoft.util.DataSerializable, inetsoft.util.XMLSerializable, Serializable, Cloneable, Comparable

public final class DateRangeRef
extends ExpressionRef
implements AssetObject, XConstants, SQLExpressionRef, RangeRef, DataRefWrapper

DateRangeRef represents a date range data ref. if not full, only the date value of the date option will be returned. Otherwise, the higher level date value of the date option will also be included.

There is no higher level for year option. For quarter option, the higher level is year, so the full value format should be yyyyqq (year * 100 + quarter of year). For month option, the higher level is year, so the full value format should be yyyymm (year * 100 + month of year). For week option, the higher level is year, so the full value format should be yyyyww (year * 100 + week of year). For day option, the higher level is year and month, so the full value format should be yyyymmdd (year * 10000 + month of year * 100 + day of month).

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class inetsoft.uql.erm.ExpressionRef
ExpressionRef.AttributeEnumeration
 
Field Summary
static int DAY_INTERVAL
          Day Option.
static int DAY_OF_MONTH_PART
          Day Of Month Part.
static int DAY_OF_WEEK_PART
          Day Of Week Part.
static int HOUR_INTERVAL
          Hour Option.
static int HOUR_OF_DAY_PART
          Hour Of Day Part.
static int MINUTE_INTERVAL
          Minute Option.
static int MONTH_INTERVAL
          Month Option.
static int MONTH_OF_YEAR_PART
          Month Of Year Part.
static int NONE_INTERVAL
          None Option.
static int QUARTER_INTERVAL
          Quarter Option.
static int QUARTER_OF_YEAR_PART
          Quarter Of Year Part.
static int SECOND_INTERVAL
          Second Option.
static int WEEK_INTERVAL
          Week Option.
static int WEEK_OF_YEAR_PART
          Week Of Year Part.
static int YEAR_INTERVAL
          Year Option.
 
Fields inherited from class inetsoft.uql.erm.AbstractDataRef
chash, cname
 
Fields inherited from interface inetsoft.uql.XConstants
AM_PM_DATE_GROUP, AM_PM_OF_DAY_DATE_GROUP, AVERAGE_FORMULA, CALC_FORMULA, COLUMN, CONCAT_FORMULA, CONDITION_EMPTY_STRING, CONDITION_NULL_STRING, CONDITION_NULL_VALUE, CONDITION_REAL_NULL, CORRELATION_FORMULA, COUNT_FORMULA, COVARIANCE_FORMULA, CURRENCY_FORMAT, CURRENT_REP_CHANGED, CURRENT_REP_WILL_CHANGE, DATE_FORMAT, DAY_DATE_GROUP, DAY_OF_MONTH_DATE_GROUP, DAY_OF_WEEK_DATE_GROUP, DAY_OF_YEAR_DATE_GROUP, DECIMAL_FORMAT, DISTINCTCOUNT_FORMULA, FIRST_FORMULA, FULL_JOIN, GREATER_EQUAL_JOIN, GREATER_JOIN, GROUP_OTHERS, HOUR_DATE_GROUP, HOUR_OF_DAY_DATE_GROUP, INNER_JOIN, JOIN, LAST_FORMULA, LEAVE_OTHERS, LEFT_JOIN, LESS_EQUAL_JOIN, LESS_JOIN, MAX_FORMULA, MEDIAN_FORMULA, MESSAGE_FORMAT, MILLISECOND_DATE_GROUP, MIN_FORMULA, MINUTE_DATE_GROUP, MODE_FORMULA, MONTH_DATE_GROUP, MONTH_OF_YEAR_DATE_GROUP, NONE_DATE_GROUP, NONE_FORMULA, NOT_EQUAL_JOIN, NTHLARGEST_FORMULA, NTHMOSTFREQUENT_FORMULA, NTHSMALLEST_FORMULA, PARAM_PREFIX, PART_DATE_GROUP, PERCENT_FORMAT, PERCENTAGE_BY_COL, PERCENTAGE_BY_ROW, PERCENTAGE_NONE, PERCENTAGE_OF_COL_GRANDTOTAL, PERCENTAGE_OF_COL_GROUP, PERCENTAGE_OF_GRANDTOTAL, PERCENTAGE_OF_GROUP, PERCENTAGE_OF_ROW_GRANDTOTAL, PERCENTAGE_OF_ROW_GROUP, POPULATIONSTANDARDDEVIATION_FORMULA, POPULATIONVARIANCE_FORMULA, PRODUCT_FORMULA, PTHPERCENTILE_FORMULA, QUARTER_DATE_GROUP, QUARTER_OF_YEAR_DATE_GROUP, RIGHT_JOIN, SECOND_DATE_GROUP, SET_FORMULA, SORT_ASC, SORT_DESC, SORT_NONE, SORT_ORIGINAL, SORT_SPECIFIC, SORT_VALUE_ASC, SORT_VALUE_DESC, STANDARDDEVIATION_FORMULA, SUB_QUERY_PARAM, SUM_FORMULA, SUMSQ_FORMULA, SUMWT_FORMULA, VARIANCE_FORMULA, WEEK_DATE_GROUP, WEEK_OF_MONTH_DATE_GROUP, WEEK_OF_YEAR_DATE_GROUP, WEIGHTEDAVERAGE_FORMULA, YEAR_DATE_GROUP
 
Fields inherited from interface inetsoft.uql.erm.DataRef
AGG_CALC, CUBE, CUBE_DIMENSION, CUBE_MEASURE, CUBE_MODEL_DIMENSION, CUBE_MODEL_TIME_DIMENSION, CUBE_TIME_DIMENSION, DIMENSION, MEASURE, MODEL, NONE, TIME
 
Constructor Summary
DateRangeRef()
          Constructor.
DateRangeRef(String attr)
          Constructor.
DateRangeRef(String attr, DataRef ref)
          Constructor.
DateRangeRef(String attr, DataRef ref, int option)
          Constructor.
 
Method Summary
 String getAttribute()
          Get the referenced attribute.
 Enumeration getAttributes()
          Get a list of all attributes that are referenced by this object.
static Object getData(int option, Date date)
          Get the integer value by the specified date value and date option.
static Object getData(int option, Date date, Calendar calendar)
          Get the integer value by the specified date value and date option.
 Class getDataClass()
          Get the data class.
 DataRef getDataRef()
          Get the contained data ref.
 String getDataType()
          Get the data type.
static String getDataType(int option)
          Get data type for a specfied option.
 int getDateOption()
          Get the date option.
 String getDBVersion()
          Get the database version.
 String getEntity()
          Get the attribute's parent entity.
 String getExpression()
          Get the SQL expression of this reference.
static String getExpression(String type, DataRef ref, int option)
          Get the SQL expression of this reference.
static String getExpression(String type, DataRef ref, int option, String otype)
          Get the SQL expression of this reference.
 String getName()
          Get the name of this reference.
static String getName(String attr, int option)
          Get the name of an attribute with a date range option.
 String getOriginalType()
          Get original data type.
static String getRangeValue(int option)
          Get the value of a date range option.
 int getRefType()
          Get the type of the field.
 String getScriptExpression()
          Get the script expression of this reference.
static String getScriptExpression(DataRef ref, int option)
          Get the script expression of this reference.
 boolean isApplyAutoDrill()
          Check if apply auto drill.
 boolean isAutoCreate()
          Check if this date range ref is manual create or not.
static boolean isDateTime(int option)
          Check a specified option is date time type.
 boolean isExpressionEditable()
          Check if expression is editable.
 boolean isMergeable()
          Check if this date range ref is mergeable.
static boolean isMergeable(String dbtype, int option)
          Check if this date range ref is mergeable.
 boolean isSQL()
          Check if this expression is sql expression.
static boolean isTimeOption(int option)
          Check if is time option.
protected  void parseAttributes(Element tag)
          Read in the attribute of this object from an XML tag.
protected  void parseContents(Element tag)
          Read in the contents of this object from an xml tag.
 void setApplyAutoDrill(boolean drill)
          Set whether apply auto drill.
 void setAutoCreate(boolean autoCreate)
          Set this date range ref is manual create or not.
 void setDataRef(DataRef ref)
          Set the data ref.
 void setDateOption(int option)
          Set the date option, one of the option constants defined in this class.
 void setDBVersion(String version)
          Set the database version.
 void setName(String name)
          Set the name of the field.
 void setOriginalType(String originalType)
          Set original data type.
protected  void writeAttributes(PrintWriter writer)
          Write the attributes of this object.
protected  void writeAttributes2(DataOutputStream dos)
          Write the attributes of this object.
protected  void writeCDATA(PrintWriter writer)
          Write the CDATA of this object.
protected  void writeCDATA2(DataOutputStream dos)
          Write the CDATA of this object.
protected  void writeContents(PrintWriter writer)
          Write the contents of this object.
protected  void writeContents2(DataOutputStream dos)
          Write the contents of this object.
 
Methods inherited from class inetsoft.uql.erm.ExpressionRef
equalsContent, getCalcAttributes, getDataSource, getDBType, getEntities, getScriptExpression, getSQLExpression, isExpression, isOnAggregate, isVirtual, parseCDATA, setDataSource, setDBType, setEntity, setExpression, setOnAggregate, setRefType, setVirtual, toString, toView
 
Methods inherited from class inetsoft.uql.erm.AbstractDataRef
addr, clone, compareTo, createDataRef, equals, equals, getClass, getDefaultFormula, getTypeNode, hashCode, isEmpty, isEntityBlank, parseData, parseXML, writeData, writeXML
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface inetsoft.uql.asset.AssetObject
clone
 
Methods inherited from interface inetsoft.uql.asset.SQLExpressionRef
getDBType, setDBType
 
Methods inherited from interface inetsoft.uql.erm.DataRef
addr, clone, equals, getDefaultFormula, getEntities, getTypeNode, isEmpty, isEntityBlank, isExpression, parseData, toView, writeData
 
Methods inherited from interface inetsoft.util.XMLSerializable
parseXML, writeXML
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Field Detail

YEAR_INTERVAL

public static final int YEAR_INTERVAL
Year Option.

See Also:
Constant Field Values

QUARTER_INTERVAL

public static final int QUARTER_INTERVAL
Quarter Option.

See Also:
Constant Field Values

MONTH_INTERVAL

public static final int MONTH_INTERVAL
Month Option.

See Also:
Constant Field Values

WEEK_INTERVAL

public static final int WEEK_INTERVAL
Week Option.

See Also:
Constant Field Values

DAY_INTERVAL

public static final int DAY_INTERVAL
Day Option.

See Also:
Constant Field Values

HOUR_INTERVAL

public static final int HOUR_INTERVAL
Hour Option.

See Also:
Constant Field Values

MINUTE_INTERVAL

public static final int MINUTE_INTERVAL
Minute Option.

See Also:
Constant Field Values

SECOND_INTERVAL

public static final int SECOND_INTERVAL
Second Option.

See Also:
Constant Field Values

QUARTER_OF_YEAR_PART

public static final int QUARTER_OF_YEAR_PART
Quarter Of Year Part.

See Also:
Constant Field Values

MONTH_OF_YEAR_PART

public static final int MONTH_OF_YEAR_PART
Month Of Year Part.

See Also:
Constant Field Values

WEEK_OF_YEAR_PART

public static final int WEEK_OF_YEAR_PART
Week Of Year Part.

See Also:
Constant Field Values

DAY_OF_MONTH_PART

public static final int DAY_OF_MONTH_PART
Day Of Month Part.

See Also:
Constant Field Values

DAY_OF_WEEK_PART

public static final int DAY_OF_WEEK_PART
Day Of Week Part.

See Also:
Constant Field Values

HOUR_OF_DAY_PART

public static final int HOUR_OF_DAY_PART
Hour Of Day Part.

See Also:
Constant Field Values

NONE_INTERVAL

public static final int NONE_INTERVAL
None Option. As-Is.

See Also:
Constant Field Values
Constructor Detail

DateRangeRef

public DateRangeRef()
Constructor.


DateRangeRef

public DateRangeRef(String attr)
Constructor.


DateRangeRef

public DateRangeRef(String attr,
                    DataRef ref)
Constructor.


DateRangeRef

public DateRangeRef(String attr,
                    DataRef ref,
                    int option)
Constructor.

Method Detail

isTimeOption

public static boolean isTimeOption(int option)
Check if is time option.


isDateTime

public static boolean isDateTime(int option)
Check a specified option is date time type.


getDataType

public static String getDataType(int option)
Get data type for a specfied option.


getName

public static String getName(String attr,
                             int option)
Get the name of an attribute with a date range option.


getRangeValue

public static String getRangeValue(int option)
Get the value of a date range option.


getData

public static Object getData(int option,
                             Date date)
Get the integer value by the specified date value and date option. The integer value is the result of a full DateRangeRef, and the option is the date option of the full DateRangeRef. The DateRangeRef is full, so the integer value needs to contain all parts(year, week, etc.).

Parameters:
option - the date option of a full DateRangeRef.
date - the date value.

getData

public static Object getData(int option,
                             Date date,
                             Calendar calendar)
Get the integer value by the specified date value and date option. The integer value is the result of a full DateRangeRef, and the option is the date option of the full DateRangeRef. The DateRangeRef is full, so the integer value needs to contain all parts(year, week, etc.).

Parameters:
option - the date option of a full DateRangeRef.
date - the date value.
Returns:
date object for date range, and integer object for date part.

getDBVersion

public String getDBVersion()
Get the database version.

Specified by:
getDBVersion in interface SQLExpressionRef

setDBVersion

public void setDBVersion(String version)
Set the database version.

Specified by:
setDBVersion in interface SQLExpressionRef

getDateOption

public int getDateOption()
Get the date option.

Returns:
the date option.

setDateOption

public void setDateOption(int option)
Set the date option, one of the option constants defined in this class.

Parameters:
option - the specified date option.

getRefType

public int getRefType()
Get the type of the field.

Specified by:
getRefType in interface DataRef
Overrides:
getRefType in class ExpressionRef
Returns:
the type of the field.

getEntity

public String getEntity()
Get the attribute's parent entity.

Specified by:
getEntity in interface DataRef
Overrides:
getEntity in class ExpressionRef
Returns:
the name of the entity.

getAttribute

public String getAttribute()
Get the referenced attribute.

Specified by:
getAttribute in interface DataRef
Overrides:
getAttribute in class ExpressionRef
Returns:
the name of the attribute.

getDataRef

public DataRef getDataRef()
Get the contained data ref.

Specified by:
getDataRef in interface DataRefWrapper
Specified by:
getDataRef in interface RangeRef
Returns:
the contained data ref.

setDataRef

public void setDataRef(DataRef ref)
Set the data ref.

Specified by:
setDataRef in interface DataRefWrapper
Specified by:
setDataRef in interface RangeRef
Parameters:
ref - the specified data ref.

getOriginalType

public String getOriginalType()
Get original data type.


setOriginalType

public void setOriginalType(String originalType)
Set original data type.


getDataType

public String getDataType()
Get the data type.

Specified by:
getDataType in interface DataRef
Overrides:
getDataType in class AbstractDataRef
Returns:
the data type defined in XSchema.

getDataClass

public Class getDataClass()
Get the data class.


writeAttributes

protected void writeAttributes(PrintWriter writer)
Write the attributes of this object.

Overrides:
writeAttributes in class ExpressionRef
Parameters:
writer - the output stream to which to write the XML data.

writeAttributes2

protected void writeAttributes2(DataOutputStream dos)
Write the attributes of this object.

Overrides:
writeAttributes2 in class ExpressionRef
Parameters:
writer - the output stream to which to write the OutputStream data.

parseAttributes

protected void parseAttributes(Element tag)
                        throws Exception
Read in the attribute of this object from an XML tag.

Overrides:
parseAttributes in class ExpressionRef
Parameters:
tag - the XML element representing this object.
Throws:
Exception

writeContents

protected void writeContents(PrintWriter writer)
Write the contents of this object.

Overrides:
writeContents in class AbstractDataRef
Parameters:
writer - the output stream to which to write the XML data.

writeContents2

protected void writeContents2(DataOutputStream dos)
Write the contents of this object.

Overrides:
writeContents2 in class AbstractDataRef
Parameters:
writer - the output stream to which to write the OutputStream data.

parseContents

protected void parseContents(Element tag)
                      throws Exception
Read in the contents of this object from an xml tag.

Overrides:
parseContents in class AbstractDataRef
Parameters:
tag - the specified xml element.
Throws:
Exception

getName

public String getName()
Get the name of this reference.

Specified by:
getName in interface DataRef
Overrides:
getName in class ExpressionRef
Returns:
the reference name.

setName

public void setName(String name)
Set the name of the field.

Overrides:
setName in class ExpressionRef
Parameters:
the - name of the field

getExpression

public String getExpression()
Get the SQL expression of this reference.

Overrides:
getExpression in class ExpressionRef
Returns:
a SQL expression.

getExpression

public static String getExpression(String type,
                                   DataRef ref,
                                   int option)
Get the SQL expression of this reference.

Returns:
a SQL expression.

getExpression

public static String getExpression(String type,
                                   DataRef ref,
                                   int option,
                                   String otype)
Get the SQL expression of this reference.

Returns:
a SQL expression.

isMergeable

public static boolean isMergeable(String dbtype,
                                  int option)
Check if this date range ref is mergeable.

Returns:
true if mergeable, false otherwise.

isMergeable

public boolean isMergeable()
Check if this date range ref is mergeable.

Specified by:
isMergeable in interface SQLExpressionRef
Returns:
true if mergeable, false otherwise.

isExpressionEditable

public boolean isExpressionEditable()
Check if expression is editable.

Overrides:
isExpressionEditable in class ExpressionRef
Returns:
true if editable, false otherwise.

getScriptExpression

public String getScriptExpression()
Get the script expression of this reference.

Overrides:
getScriptExpression in class ExpressionRef
Returns:
a script expression.

getScriptExpression

public static String getScriptExpression(DataRef ref,
                                         int option)
Get the script expression of this reference.

Returns:
a script expression.

isSQL

public boolean isSQL()
Check if this expression is sql expression.

Overrides:
isSQL in class ExpressionRef
Returns:
true if is, false otherwise.

setAutoCreate

public void setAutoCreate(boolean autoCreate)
Set this date range ref is manual create or not.


isAutoCreate

public boolean isAutoCreate()
Check if this date range ref is manual create or not.

Returns:
true if is, false otherwise.

getAttributes

public Enumeration getAttributes()
Get a list of all attributes that are referenced by this object.

Specified by:
getAttributes in interface DataRef
Overrides:
getAttributes in class ExpressionRef
Returns:
an Enumeration containing AttributeRef objects.

writeCDATA

protected void writeCDATA(PrintWriter writer)
Write the CDATA of this object.

Overrides:
writeCDATA in class ExpressionRef
Parameters:
writer - the output stream to which to write the XML data

writeCDATA2

protected void writeCDATA2(DataOutputStream dos)
Write the CDATA of this object.

Overrides:
writeCDATA2 in class ExpressionRef
Parameters:
writer - the output stream to which to write the OutputStream data.

isApplyAutoDrill

public boolean isApplyAutoDrill()
Check if apply auto drill.


setApplyAutoDrill

public void setApplyAutoDrill(boolean drill)
Set whether apply auto drill.


Copyright © 1996-2014 InetSoft Technology Corp. All Rights Reserved.