com.sas.iquery.metadata.expr.relational
Class RelativeTimestampValueExpression
com.sas.iquery.metadata.expr.relational.RelativeTimestampValueExpression
All Implemented Interfaces: Base , BusinessModelResourceReferencer , ModelItem , UsabilityInterface , ExpressionInterface , PropertyChangeListenee , java.beans.PropertyChangeListener , java.lang.Cloneable , java.util.EventListener
public class RelativeTimestampValueExpression
Models relative timestamp-oriented values used within filter
sub-expressions.
This class is used to generate an expression for a relative timestamp. This timestamp may
be represented in SAS as datetime()
to represent now, or an
interval time such as intnx("dtweek",datetime(),-1,"sameday")
to
represent the same day last week.
This time is creating by setting the following variables:
Alignment - TimeShiftAlignment
Direction - TimeShiftDirection
Multiplier - integer
Unit - TimeShiftUnit
ShiftFrom - Expression
Methods inherited from class com.sas.iquery.metadata.expr.relational.AbstractRelativeTimeValueExpression
getAlignment , getRelativeSASDateExpression , getShiftDirection , getShiftingFrom , getShiftMultiplier , getShiftUnit , isConstant , setAlignment , setShiftDirection , setShiftMultiplier , setShiftUnit
DATETIME
public static final FunctionCall DATETIME
DATETIME represents the current date and time.
RelativeTimestampValueExpression
public RelativeTimestampValueExpression ()
Constructor for RelativeTimestampValueExpression
RelativeTimestampValueExpression
public RelativeTimestampValueExpression (ExpressionInterface shiftFrom,
TimeShiftUnit unitValue,
TimeShiftDirection directionValue,
int multiplierValue,
TimeShiftAlignment alignmentValue)
Create a RelativeTimestampValueExpression setting all values using input.
Parameters: shiftFrom
- Must be an expression of type ExpressionTypes.EXP_TYPE_DATE
unitValue
- directionValue
- multiplierValue
- alignmentValue
-
setShiftingFrom
public void setShiftingFrom (ExpressionInterface exp)
throws java.lang.IllegalArgumentException ,
MetadataException
Description copied from class: AbstractRelativeTimeValueExpression
Set the date/time to shift from. This checks to ensure that it does not set the object
itself as the shifting from. In that case the current shift remains in place.
This throws an exception if the current object is a constant expression, this can
be check with isConstant()
method.
Overrides: setShiftingFrom
in class AbstractRelativeTimeValueExpression
Parameters: exp
- ExpressionInterface
Throws:
java.lang.IllegalArgumentException
MetadataException
See Also: AbstractRelativeTimeValueExpression.setShiftingFrom(com.sas.iquery.metadata.expr.ExpressionInterface)
getExpressionType
public int getExpressionType ()
Description copied from interface: ExpressionInterface
Return the integer form of the expression type.
Specified by: getExpressionType
in interface ExpressionInterface
Specified by: getExpressionType
in class AbstractRelativeTimeValueExpression
Returns: int See Also: AbstractRelativeTimeValueExpression.getExpressionType()
Copyright © 2009 SAS Institute Inc. All Rights Reserved.