com.flexive.shared.search
Enum DateFunction

java.lang.Object
  extended by java.lang.Enum<DateFunction>
      extended by com.flexive.shared.search.DateFunction
All Implemented Interfaces:
FxSQLFunction, java.io.Serializable, java.lang.Comparable<DateFunction>

public enum DateFunction
extends java.lang.Enum<DateFunction>
implements FxSQLFunction

FxSQL functions available for date/datetime queries and selects.

Version:
$Rev: 2919 $
Author:
Daniel Lichtenberger (daniel.lichtenberger@flexive.com), UCS - unique computing solutions gmbh (http://www.ucs.at)

Enum Constant Summary
DAY
           
HOUR
           
MINUTE
           
MONTH
           
SECOND
           
YEAR
           
 
Method Summary
static DateFunction getBySqlName(java.lang.String sqlName)
          Return the date function for the given FxSQL name (e.g.
 FxDataType getOverrideDataType()
          Specify the datatype this function returns.
 java.lang.String getSqlName()
          Return the FxSQL name of the function, e.g.
static DateFunction valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static DateFunction[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

YEAR

public static final DateFunction YEAR

MONTH

public static final DateFunction MONTH

DAY

public static final DateFunction DAY

HOUR

public static final DateFunction HOUR

MINUTE

public static final DateFunction MINUTE

SECOND

public static final DateFunction SECOND
Method Detail

values

public static DateFunction[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (DateFunction c : DateFunction.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static DateFunction valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null

getSqlName

public java.lang.String getSqlName()
Description copied from interface: FxSQLFunction
Return the FxSQL name of the function, e.g. "year".

Specified by:
getSqlName in interface FxSQLFunction
Returns:
the FxSQL name of the function, e.g. "year".

getOverrideDataType

public FxDataType getOverrideDataType()
Description copied from interface: FxSQLFunction
Specify the datatype this function returns. If null, the original datatype of the expression should be used.

Specified by:
getOverrideDataType in interface FxSQLFunction
Returns:
the datatype this function returns

getBySqlName

public static DateFunction getBySqlName(java.lang.String sqlName)
Return the date function for the given FxSQL name (e.g. "year").

Parameters:
sqlName - the FxSQL function name
Returns:
the date function
Throws:
FxRuntimeException - if the given SQL name is not a date function