***  This class is subject to change.  ***

com.sas.iquery.metadata.expr.relational
Class AbstractRelativeTimeValueExpression

com.sas.iquery.metadata.expr.relational.AbstractRelativeTimeValueExpression
All Implemented Interfaces:
Base, BusinessModelResourceReferencer, ModelItem, UsabilityInterface, ExpressionInterface, PropertyChangeListenee, java.beans.PropertyChangeListener, java.lang.Cloneable, java.util.EventListener
Direct Known Subclasses:
RelativeDateValueExpression, RelativeTimestampValueExpression

public abstract class AbstractRelativeTimeValueExpression

Base class used to model relative time-oriented value used within filter sub-expressions. This object controls the shifting of time from one point in time to another. This shifting is done through the use of a shifting shiftDirection, shifting shiftMultiplier, shifting shiftUnit, and shifting alignment. The date the shift starts from is the shiftingFrom value.

See Also:
RelativeDateValueExpression

Field Summary
static java.lang.String EVENT_ALIGNMENT_CHANGED
          Designates a change in the modifier object.
static java.lang.String EVENT_MULTIPLIER_CHANGED
          Designates a change in the modifier object.
static java.lang.String EVENT_SHIFT_DIRECTION_CHANGED
          Designates a change in the shift direction object.
static java.lang.String EVENT_SHIFT_FROM_CHANGED
          Designates a change in the modifier object.
static java.lang.String EVENT_UNIT_CHANGED
          Designates a change in the shiftUnit object.
 
Fields inherited from interface com.sas.iquery.metadata.business.ModelItem
EVENT_OBJECT_PROPERTY_CHANGED
 
Fields inherited from interface com.sas.iquery.metadata.business.Base
EVENT_OBJECT_DEFINITION_CHANGED
 
Method Summary
 TimeShiftAlignment getAlignment()
          Starting alignment is used to align the outputing time to the begining, end, middle, or sameday of the output shiftUnit.
abstract  int getExpressionType()
          Return the integer form of the expression type.
static AbstractRelativeTimeValueExpression getRelativeSASDateExpression()
          This is used to create an instance of a AbstractRelativeTimeValueExpression to be used as a standard definiton for when the value is adjusted from today()
 TimeShiftDirection getShiftDirection()
          Get the shiftDirection of shift for this date object.
 ExpressionInterface getShiftingFrom()
          Get the starting point for this shift.
 int getShiftMultiplier()
          Return the shiftMultiplier for this output.
 TimeShiftUnit getShiftUnit()
          Method getUnit
 boolean isConstant()
          Check to see if this expression is a constant value.
 void setAlignment(TimeShiftAlignment alignment)
          Starting alignment is used to align the outputing time to the begining, end, middle, or sameday of the output shiftUnit.
 void setShiftDirection(TimeShiftDirection direction)
          Set the shiftDirection of shift for this date object.
 void setShiftingFrom(ExpressionInterface exp)
          Set the date/time to shift from.
 void setShiftMultiplier(int multiplier)
          Set the shiftMultiplier used for output.
 void setShiftUnit(TimeShiftUnit unit)
          Method setUnit
 
Methods inherited from interface com.sas.iquery.metadata.business.BusinessModelResourceReferencer
getResources
 
Methods inherited from interface com.sas.iquery.metadata.PropertyChangeListenee
addListener, getListeners, removeListener
 
Methods inherited from interface com.sas.iquery.metadata.business.UsabilityInterface
getReasonsUnusable, isUsableInQuery
 

Field Detail

***  This field is subject to change.  ***

EVENT_UNIT_CHANGED

public static final java.lang.String EVENT_UNIT_CHANGED
Designates a change in the shiftUnit object.

See Also:
Constant Field Values

***  This field is subject to change.  ***

EVENT_MULTIPLIER_CHANGED

public static final java.lang.String EVENT_MULTIPLIER_CHANGED
Designates a change in the modifier object.

See Also:
Constant Field Values

***  This field is subject to change.  ***

EVENT_ALIGNMENT_CHANGED

public static final java.lang.String EVENT_ALIGNMENT_CHANGED
Designates a change in the modifier object.

See Also:
Constant Field Values

***  This field is subject to change.  ***

EVENT_SHIFT_DIRECTION_CHANGED

public static final java.lang.String EVENT_SHIFT_DIRECTION_CHANGED
Designates a change in the shift direction object.

See Also:
Constant Field Values

***  This field is subject to change.  ***

EVENT_SHIFT_FROM_CHANGED

public static final java.lang.String EVENT_SHIFT_FROM_CHANGED
Designates a change in the modifier object.

See Also:
Constant Field Values
Method Detail
***  This method is subject to change.  ***

getRelativeSASDateExpression

public static AbstractRelativeTimeValueExpression getRelativeSASDateExpression()
This is used to create an instance of a AbstractRelativeTimeValueExpression to be used as a standard definiton for when the value is adjusted from today()

Returns:
a default instance of AbstractRelativeTimeValueExpression

***  This method is subject to change.  ***

getExpressionType

public abstract int getExpressionType()
Description copied from interface: ExpressionInterface
Return the integer form of the expression type.

Returns:
The type of expression this is: Date, Datetime, Time
See Also:
ExpressionInterface.getExpressionType()

***  This method is subject to change.  ***

getAlignment

public TimeShiftAlignment getAlignment()
Starting alignment is used to align the outputing time to the begining, end, middle, or sameday of the output shiftUnit. This method returns that alignment object.

Returns:
Returns the shiftAlignment.

***  This method is subject to change.  ***

setAlignment

public void setAlignment(TimeShiftAlignment alignment)
                  throws MetadataException,
                         java.lang.IllegalArgumentException
Starting alignment is used to align the outputing time to the begining, end, middle, or sameday of the output shiftUnit. This method returns that alignment object.

Parameters:
alignment - The shiftAlignment to set.
Throws:
MetadataException
java.lang.IllegalArgumentException - if null or invalid arguement passed in.

***  This method is subject to change.  ***

getShiftUnit

public TimeShiftUnit getShiftUnit()
Method getUnit

Returns:
TimeShiftUnit

***  This method is subject to change.  ***

setShiftUnit

public void setShiftUnit(TimeShiftUnit unit)
                  throws MetadataException,
                         java.lang.IllegalArgumentException
Method setUnit

Parameters:
unit - TimeShiftUnit set units to shift by.
Throws:
MetadataException
java.lang.IllegalArgumentException - if null or invalid arguement passed in.

***  This method is subject to change.  ***

getShiftMultiplier

public int getShiftMultiplier()
Return the shiftMultiplier for this output.

Returns:
shiftMultiplier for this modifier.

***  This method is subject to change.  ***

setShiftMultiplier

public void setShiftMultiplier(int multiplier)
                        throws MetadataException
Set the shiftMultiplier used for output. Default value is one. If a negative value is given then its absolute value is used.

Parameters:
multiplier -
Throws:
MetadataException
java.lang.IllegalArgumentException - if this is a static instance such as CURRENT,NEXT,PREVIOUS

***  This method is subject to change.  ***

getShiftingFrom

public ExpressionInterface getShiftingFrom()
Get the starting point for this shift.

Returns:
ExpressionInterface
See Also:
getShiftingFrom()

***  This method is subject to change.  ***

setShiftingFrom

public void setShiftingFrom(ExpressionInterface exp)
                     throws java.lang.IllegalArgumentException,
                            MetadataException
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.

Parameters:
exp - ExpressionInterface of time to shift from.
Throws:
java.lang.IllegalArgumentException
MetadataException
See Also:
setShiftingFrom(com.sas.iquery.metadata.expr.ExpressionInterface)

***  This method is subject to change.  ***

getShiftDirection

public TimeShiftDirection getShiftDirection()
Get the shiftDirection of shift for this date object.

Returns:
TimeShiftDirection value.

***  This method is subject to change.  ***

setShiftDirection

public void setShiftDirection(TimeShiftDirection direction)
                       throws MetadataException,
                              java.lang.IllegalArgumentException
Set the shiftDirection of shift for this date object.

Parameters:
direction - to move in time.
Throws:
MetadataException
java.lang.IllegalArgumentException - if null or invalid arguement passed in.

***  This method is subject to change.  ***

isConstant

public boolean isConstant()
Check to see if this expression is a constant value.

Returns:
true if constant, false otherwise.

***  This class is subject to change.  ***




Copyright © 2009 SAS Institute Inc. All Rights Reserved.