Style Intelligence v12.0

inetsoft.uql.asset
Class DateCondition

java.lang.Object
  extended by inetsoft.uql.AbstractCondition
      extended by inetsoft.uql.asset.DateCondition
All Implemented Interfaces:
AssetObject, XCondition, inetsoft.util.ContentObject, inetsoft.util.XMLSerializable, Serializable, Cloneable
Direct Known Subclasses:
DateCondition.DayCondition, DateCondition.DaysCondition, DateCondition.MonthCondition, DateCondition.MonthsCondition, DateCondition.NthHalfYearCondition, DateCondition.NthMonthCondition, DateCondition.NthQuarterCondition, DateCondition.QuarterCondition, DateCondition.ToDateCondition, DateCondition.WeekCondition, DateCondition.WeeksCondition, DateCondition.YearCondition, DateRange, PeriodCondition

public abstract class DateCondition
extends AbstractCondition
implements AssetObject

Date condition, a predefined condition evaluates Date objects.

See Also:
Serialized Form

Nested Class Summary
static class DateCondition.DayCondition
          Day condition.
static class DateCondition.DaysCondition
          Days condition.
static class DateCondition.MonthCondition
          Month condition.
static class DateCondition.MonthsCondition
          Months condition.
static class DateCondition.NthHalfYearCondition
          Nth half year condition.
static class DateCondition.NthMonthCondition
          Nth month condition.
static class DateCondition.NthQuarterCondition
          Nth quarter condition.
static class DateCondition.QuarterCondition
          Quarter condition.
static class DateCondition.REFERENCE
          Constants for specifying Date parts.
static class DateCondition.ToDateCondition
          ToDateCondition represents a date range from a start reference (e.g.
static class DateCondition.WeekCondition
          Week condition.
static class DateCondition.WeeksCondition
          Weeks condition.
static class DateCondition.YearCondition
          Year condition.
 
Field Summary
protected  Calendar CALENDAR
           
static long ONE_DAY
          One day milliseconds.
protected static TimeZone ZONE
           
 
Fields inherited from class inetsoft.uql.AbstractCondition
equal, negated, op, type
 
Fields inherited from interface inetsoft.uql.XCondition
BETWEEN, BOTTOM_N, CONTAINS, CORRELATED, DATE_IN, EQUAL_TO, GREATER_THAN, LESS_THAN, LIKE, NONE, NULL, ONE_OF, PSEUDO, STARTING_WITH, TOP_N
 
Constructor Summary
DateCondition()
          Constructor.
 
Method Summary
 Object clone()
          Clone the object.
protected  Condition createSqlCondition(Date date1, Date date2)
          Create a sql condition, this condition is date type which is between date1 and date2.
 UserVariable[] getAllVariables()
          Get all variables in the condition value list.
static DateCondition[] getBuiltinDateConditions()
          Get all the built-in date conditions.
protected  long getDate(Calendar cal)
          Get the date(only includes year, month and day) from a calendar.
 int getDays(Date date)
          Get the days of a date from 1970-01-01 on.
 int getHalfYear(Date date)
          Get the half year of a date.
 String getLabel()
          Get the label.
 int getMonth(Date date)
          Get the month of a date.
 int getMonths(Date date)
          Get the month of a date.
 String getName()
          Get the name.
 int getQuarter(Date date)
          Get the quarter of a date.
 int getWeeks(Date date)
          Get the weeks of a date from 1970-01-01 on.
 int getYear(Date date)
          Get the year of a date.
 boolean isEqualChangeable()
          Check if equal is changeable.
 boolean isNegatedChangeable()
          Check if negated is changeable.
 boolean isOperationChangeable()
          Check if operation is changeable.
 boolean isTypeChangeable()
          Check if type is changeable.
 void parseContents(Element elem)
          Parse the contents.
 void replaceVariable(VariableTable vars)
          Replace all embeded user variables.
 boolean setBuiltinDateConditions(DateCondition[] conditions)
          Set all the built-in date conditions.
 void setLabel(String label)
          Set the label.
 void setName(String name)
          Set the name.
abstract  Condition toSqlCondition()
          Convert this condition to sql mergeable condition.
 Condition toSqlCondition(boolean isTimestamp)
          Convert this condition to sql mergeable condition.
 String toString()
          Get the string representation.
 void writeContents(PrintWriter writer)
          Write the contents.
 
Methods inherited from class inetsoft.uql.AbstractCondition
checkValueString, createDefaultValue, createXCondition, equals, equalsContent, getBoolean, getDate, getDateObject, getObject, getObject, getOperation, getType, getValueSQLString, getValueString, getValueString, getValueString, isEqual, isNegated, parseAttributes, parseXML, printKey, setEqual, setNegated, setOperation, setType, writeAttributes, writeXML
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface inetsoft.util.XMLSerializable
parseXML, writeXML
 
Methods inherited from interface inetsoft.uql.XCondition
evaluate, isValid
 

Field Detail

ONE_DAY

public static final long ONE_DAY
One day milliseconds.

See Also:
Constant Field Values

ZONE

protected static final TimeZone ZONE

CALENDAR

protected Calendar CALENDAR
Constructor Detail

DateCondition

public DateCondition()
Constructor.

Method Detail

getBuiltinDateConditions

public static DateCondition[] getBuiltinDateConditions()
Get all the built-in date conditions.

Returns:
all the available date conditions.

setBuiltinDateConditions

public boolean setBuiltinDateConditions(DateCondition[] conditions)
Set all the built-in date conditions.

Parameters:
conditions - the specified date conditions.
Returns:
true if successful, false otherwise.

getYear

public int getYear(Date date)
Get the year of a date.

Parameters:
date - the specified date.
Returns:
the year of the date.

getHalfYear

public int getHalfYear(Date date)
Get the half year of a date.

Parameters:
date - the specified date.
Returns:
the half year of the date.

getQuarter

public int getQuarter(Date date)
Get the quarter of a date.

Parameters:
date - the specified date.
Returns:
the quarter of the date.

getMonth

public int getMonth(Date date)
Get the month of a date.

Parameters:
date - the specified date.
Returns:
the month of the date.

getMonths

public int getMonths(Date date)
Get the month of a date.

Parameters:
date - the specified date.
Returns:
the month of the date.

getWeeks

public int getWeeks(Date date)
Get the weeks of a date from 1970-01-01 on.

Parameters:
date - the specified date.
Returns:
the week of the date.

getDays

public int getDays(Date date)
Get the days of a date from 1970-01-01 on.

Parameters:
date - the specified date.
Returns:
the day of the date.

getName

public String getName()
Get the name.

Returns:
the name of the date condition.

setName

public void setName(String name)
Set the name.

Parameters:
name - the specified name.

getLabel

public String getLabel()
Get the label.

Returns:
the label of the date condition.

setLabel

public void setLabel(String label)
Set the label.

Parameters:
label - the specified label.

isTypeChangeable

public boolean isTypeChangeable()
Check if type is changeable.

Specified by:
isTypeChangeable in interface XCondition
Returns:
true if changeable, false otherwise.

isOperationChangeable

public boolean isOperationChangeable()
Check if operation is changeable.

Specified by:
isOperationChangeable in interface XCondition
Returns:
true if changeable, false otherwise.

isEqualChangeable

public boolean isEqualChangeable()
Check if equal is changeable.

Specified by:
isEqualChangeable in interface XCondition
Returns:
true if changeable, false otherwise.

isNegatedChangeable

public boolean isNegatedChangeable()
Check if negated is changeable.

Specified by:
isNegatedChangeable in interface XCondition
Returns:
true if changeable, false otherwise.

replaceVariable

public void replaceVariable(VariableTable vars)
Replace all embeded user variables.

Specified by:
replaceVariable in interface XCondition
Parameters:
vars - the specified variable table.

getAllVariables

public UserVariable[] getAllVariables()
Get all variables in the condition value list.

Specified by:
getAllVariables in interface XCondition
Returns:
the variable list.

writeContents

public void writeContents(PrintWriter writer)
Write the contents.

Specified by:
writeContents in interface XCondition
Parameters:
writer - the specified print writer.

parseContents

public void parseContents(Element elem)
                   throws Exception
Parse the contents.

Specified by:
parseContents in interface XCondition
Parameters:
elem - the specified xml element.
Throws:
Exception

toSqlCondition

public abstract Condition toSqlCondition()
Convert this condition to sql mergeable condition.


toSqlCondition

public Condition toSqlCondition(boolean isTimestamp)
Convert this condition to sql mergeable condition.


getDate

protected long getDate(Calendar cal)
Get the date(only includes year, month and day) from a calendar.


createSqlCondition

protected Condition createSqlCondition(Date date1,
                                       Date date2)
Create a sql condition, this condition is date type which is between date1 and date2.

Parameters:
date1 - the earlier date.
date2 - the later date.

toString

public String toString()
Get the string representation.

Overrides:
toString in class Object
Returns:
the string representation.

clone

public Object clone()
Clone the object.

Specified by:
clone in interface AssetObject
Specified by:
clone in interface XCondition
Overrides:
clone in class AbstractCondition
Returns:
the cloned object.

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