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

com.sas.iquery.metadata.expr
Class ConstantExpression

com.sas.iquery.metadata.expr.ConstantExpression
All Implemented Interfaces:
Base, BusinessModelResourceReferencer, ModelItem, UsabilityInterface, com.sas.iquery.metadata.expr.ConstantExpressionInterface, ExpressionInterface, PropertyChangeListenee, java.beans.PropertyChangeListener, java.lang.Cloneable, java.util.EventListener

public class ConstantExpression
implements com.sas.iquery.metadata.expr.ConstantExpressionInterface

Specifies a constant value modeled as a string with an expression type. Since a ConstantExpression can contain a MissingValue, users of this class need to check if its value is a MissingValue before safely converting the value of a ConstantExpression to a number.

See Also:
isMissing()

Field Summary
static java.lang.String EVENT_EXPRESSION_TYPE_CHANGED
          The event thrown when the expression type has changed values.
static java.lang.String EVENT_VALUE_CHANGED
          The event thrown when the expression value has changed values.
 
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
 
Constructor Summary
ConstantExpression()
           
ConstantExpression(java.lang.String value, int type)
          Creates an ConstantExpression with the specified value and type.
 
Method Summary
 int getExpressionType()
          Return the integer form of the expression type.
 java.lang.String getValue()
          Return value of this constant in string form.
 boolean isMissing()
          Checks if this ConstantExpression's value is a SAS MissingValue
 void setExpressionType(int type)
          Sets the expression type with a value from class ExpressionTypes
 void setValue(java.lang.String value)
          Sets the value of this constant as a String object
 
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_EXPRESSION_TYPE_CHANGED

public static final java.lang.String EVENT_EXPRESSION_TYPE_CHANGED
The event thrown when the expression type has changed values.

See Also:
Constant Field Values

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

EVENT_VALUE_CHANGED

public static final java.lang.String EVENT_VALUE_CHANGED
The event thrown when the expression value has changed values.

See Also:
Constant Field Values
Constructor Detail
***  This constructor is subject to change.  ***

ConstantExpression

public ConstantExpression()

***  This constructor is subject to change.  ***

ConstantExpression

public ConstantExpression(java.lang.String value,
                          int type)
Creates an ConstantExpression with the specified value and type.

Parameters:
value - the value of the expression
type - the expression type with a value from class ExpressionTypes
Method Detail
***  This method is subject to change.  ***

getExpressionType

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

Specified by:
getExpressionType in interface ExpressionInterface
Returns:
an expression type from the values in class ExpressionTypes

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

setExpressionType

public void setExpressionType(int type)
Sets the expression type with a value from class ExpressionTypes

Specified by:
setExpressionType in interface com.sas.iquery.metadata.expr.ConstantExpressionInterface
Parameters:
type - a valid expression type
See Also:
ExpressionTypes

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

getValue

public java.lang.String getValue()
Description copied from interface: ConstantExpressionInterface
Return value of this constant in string form.

Specified by:
getValue in interface com.sas.iquery.metadata.expr.ConstantExpressionInterface
Returns:
the value of this constant as a String object If this expression's type is numeric check to make sure the returned value does not represent a SAS MissingValue before safely converting it to a number
See Also:
isMissing()

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

setValue

public void setValue(java.lang.String value)
Sets the value of this constant as a String object

Specified by:
setValue in interface com.sas.iquery.metadata.expr.ConstantExpressionInterface
Parameters:
value - string to use as the constant

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

isMissing

public boolean isMissing()
Checks if this ConstantExpression's value is a SAS MissingValue

Returns:
true if this contains a MissingValue false otherwise
See Also:
QueryMissingValues, getValue()

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




Copyright © 2009 SAS Institute Inc. All Rights Reserved.