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

com.sas.iquery.metadata.expr
Class MultipleConditionalExpression

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

public class MultipleConditionalExpression
implements FilterCascadeContainerUpdater, CascadableFilter

Models a conditional expression that is a combination of one or more Boolean subexpressions. This expression is of the form: [NOT] ( {AND|OR} applied to {Conditional or String Expression},{Conditional or String Expression},... )


Field Summary
static java.lang.String EVENT_AN_EXPRESSION_CHANGED
          Indication that an expression has changed.
static java.lang.String EVENT_EXPRESSION_LIST_CHANGED
          Indication that the expression list has changed.
static java.lang.String EVENT_RELATION_TYPE_CHANGED
          Indication that the relation type has changed.
 
Fields inherited from class com.sas.iquery.metadata.expr.ConditionalExpression
EVENT_NEGATION_CHANGED
 
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
MultipleConditionalExpression()
           
 
Method Summary
 void addExpression(ExpressionInterface condExpr)
          Appends the expression in the list
 void addExpression(int index, ExpressionInterface condExpr)
          Inserts the expression in the list at the index and shifts the current item at that index down
 void clearExpressions()
          Removes all the expressions in the list
 java.util.List getCascades(boolean recursive)
          Returns the list of FilterCascadeInterfaces set on this expression.
 ExpressionInterface getExpression()
          Returns the ExpressionInterface for this CascadableFilter.
 ExpressionInterface getExpression(int index)
          Gets the expression in the list at the index
 int getExpressionCount()
          Returns the number of expressions contained in this MultipleConditionalExpression.
 java.util.List getExpressionList()
          Gets a copy of the List of all the expressions
 ExpressionInterface[] getExpressions()
          Gets an array of all the expressions in the order they are in the list
 ConditionalRelationType getRelationType()
          Returns a relation type (AND and OR) used in creating this MultipleConditionalExpression.
protected  int[] getValidExpressionTypes()
           
 void removeExpression(int index)
          Deletes the expression at the index and shifts the other expressions one position to the left
 void setCascades(java.util.List filterCascades)
          Set the list of FilterCascadeInterfaces that are associated to this expression.
 void setExpression(int index, ExpressionInterface condExpr)
          Sets the expression in the list at the index.
 void setExpressionList(java.util.List values)
          Sets the list of expressions Each value in the list must be of type ExpressionInterface
 void setRelationType(ConditionalRelationType relationType)
          Sets the relation type with a value from class ConditionalRelationType.
 
Methods inherited from class com.sas.iquery.metadata.expr.ConditionalExpression
getExpressionType, isNegated, setIsNegated
 
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_RELATION_TYPE_CHANGED

public static final java.lang.String EVENT_RELATION_TYPE_CHANGED
Indication that the relation type has changed.

See Also:
Constant Field Values

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

EVENT_AN_EXPRESSION_CHANGED

public static final java.lang.String EVENT_AN_EXPRESSION_CHANGED
Indication that an expression has changed.

See Also:
Constant Field Values

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

EVENT_EXPRESSION_LIST_CHANGED

public static final java.lang.String EVENT_EXPRESSION_LIST_CHANGED
Indication that the expression list has changed.

See Also:
Constant Field Values
Constructor Detail

MultipleConditionalExpression

public MultipleConditionalExpression()
Method Detail
***  This method is subject to change.  ***

getRelationType

public ConditionalRelationType getRelationType()
Returns a relation type (AND and OR) used in creating this MultipleConditionalExpression.

Returns:
a relation type from the values in class ConditionalRelationType

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

getExpressionCount

public int getExpressionCount()
Returns the number of expressions contained in this MultipleConditionalExpression.

Returns:
the number of expressions in this MultipleConditionalExpression.

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

setRelationType

public void setRelationType(ConditionalRelationType relationType)
Sets the relation type with a value from class ConditionalRelationType. If there are more than one expression then the relation type MUST be set.

Parameters:
relationType -
See Also:
ConditionalRelationType

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

setExpression

public void setExpression(int index,
                          ExpressionInterface condExpr)
Sets the expression in the list at the index.

Parameters:
index - index at which the specified element is to be set (0 based)
condExpr - expression
Throws:
java.lang.UnsupportedOperationException - if the set method is not supported by this list.
java.lang.ClassCastException - if the class of the specified element prevents it from being added to this list.
java.lang.NullPointerException - if the specified element is null and this list does not support null elements.
java.lang.IllegalArgumentException - if some aspect of the specified element prevents it from being added to this list.
java.lang.IndexOutOfBoundsException - if the index is out of range (index < 0 || index >= size()).

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

addExpression

public void addExpression(int index,
                          ExpressionInterface condExpr)
Inserts the expression in the list at the index and shifts the current item at that index down

Parameters:
index - index at which the specified element is to be set (0 based)
condExpr - expression
Throws:
java.lang.ClassCastException - if the class of the specified element prevents it from being added to this list.
java.lang.NullPointerException - if the specified element is null and this list does not support null elements.
java.lang.IllegalArgumentException - if some aspect of the specified element prevents it from being added to this list.
java.lang.IndexOutOfBoundsException - if the index is out of range (index < 0 || index > size()).

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

addExpression

public void addExpression(ExpressionInterface condExpr)
Appends the expression in the list

Parameters:
condExpr - the expression that is added to this MultipleConditionalExpression.
Throws:
java.lang.ClassCastException - if the class of the specified element prevents it from being added to this list.
java.lang.NullPointerException - if the specified element is null and this list does not support null elements.
java.lang.IllegalArgumentException - if some aspect of this element prevents it from being added to this list.

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

removeExpression

public void removeExpression(int index)
Deletes the expression at the index and shifts the other expressions one position to the left

Parameters:
index -
Throws:
java.lang.IndexOutOfBoundsException - if the index is out of range (index < 0 || index >= size()).

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

clearExpressions

public void clearExpressions()
Removes all the expressions in the list


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

getExpression

public ExpressionInterface getExpression(int index)
Gets the expression in the list at the index

Parameters:
index -
Returns:
the expression at the index
Throws:
java.lang.IndexOutOfBoundsException - if the index is out of range (index < 0 || index >= size()).

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

getExpressions

public ExpressionInterface[] getExpressions()
Gets an array of all the expressions in the order they are in the list

Returns:
the expressions

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

getExpressionList

public java.util.List getExpressionList()
Gets a copy of the List of all the expressions

Returns:
List of the expressions

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

setCascades

public void setCascades(java.util.List filterCascades)
Set the list of FilterCascadeInterfaces that are associated to this expression. This call will replace the current list of cascades.

Specified by:
setCascades in interface FilterCascadeContainerUpdater
Parameters:
filterCascades - list of FilterCascadeInterfaces

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

getCascades

public java.util.List getCascades(boolean recursive)
Returns the list of FilterCascadeInterfaces set on this expression.

Specified by:
getCascades in interface FilterCascadeContainer
Parameters:
recursive - determines if the list of filter cascades returned includes all the cascades from expression that make up the current expression
Returns:
filterCascades list of FilterCascadeInterfaces

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

setExpressionList

public void setExpressionList(java.util.List values)
Sets the list of expressions Each value in the list must be of type ExpressionInterface

Parameters:
values - a list of ExpressionInterfaces.
Throws:
java.lang.ClassCastException - if the class of an element in the specified collection prevents it from being added to this list.
java.lang.NullPointerException - if the specified collection contains one or more null elements and this list does not support null elements, or if the specified collection is null.
java.lang.IllegalArgumentException - if some aspect of an element in the specified collection prevents it from being added to this list.

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

getValidExpressionTypes

protected int[] getValidExpressionTypes()
Overrides:
getValidExpressionTypes in class ConditionalExpression

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

getExpression

public ExpressionInterface getExpression()
Description copied from interface: CascadableFilter
Returns the ExpressionInterface for this CascadableFilter.

Specified by:
getExpression in interface CascadableFilter
Returns:
The underlining ExpressionInterface
See Also:
CascadableFilter.getExpression()

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




Copyright © 2009 SAS Institute Inc. All Rights Reserved.