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

com.sas.iquery.metadata.expr
Class MultipleConditionalExpression

java.lang.Object
  |
  +--com.sas.iquery.metadata.impl.IQModelImplUtilities
        |
        +--com.sas.iquery.metadata.business.impl.AbstractBase
              |
              +--com.sas.iquery.metadata.business.impl.AbstractModelItem
                    |
                    +--com.sas.iquery.metadata.impl.AbstractExpression
                          |
                          +--com.sas.iquery.metadata.expr.ConditionalExpression
                                |
                                +--com.sas.iquery.metadata.expr.MultipleConditionalExpression
All Implemented Interfaces:
Base, BusinessModelResourceReferencer, ExpressionInterface, ModelItem, PropertyChangeListenee, UsabilityInterface

public class MultipleConditionalExpression
extends ConditionalExpression

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 String EVENT_AN_EXPRESSION_CHANGED
          Indication that an expression has changed.
static String EVENT_EXPRESSION_LIST_CHANGED
          Indication that the expression list has changed.
static 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
 ExpressionInterface getExpression(int index)
          Gets the expression in the list at the index
 int getExpressionCount()
          Returns the number of expressions contained in this MultipleConditionalExpression.
 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 setExpression(int index, ExpressionInterface condExpr)
          Sets the expression in the list at the index.
 void setExpressionList(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 class com.sas.iquery.metadata.business.impl.AbstractBase
accumulateDirectlyReferencedModelsInDownwardDefinition, getDirectlyReferencedBaseObjectsInDownwardDefinition, hasCycleInDownwardDefinition
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.beans.PropertyChangeListener
propertyChange
 
Methods inherited from interface com.sas.iquery.metadata.PropertyChangeListenee
addListener, getListeners, removeListener
 
Methods inherited from interface com.sas.iquery.metadata.business.UsabilityInterface
getReasonsUnusable, isUsableInQuery
 
Methods inherited from interface com.sas.iquery.metadata.business.BusinessModelResourceReferencer
getResources
 

Field Detail

EVENT_RELATION_TYPE_CHANGED

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

EVENT_AN_EXPRESSION_CHANGED

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

EVENT_EXPRESSION_LIST_CHANGED

public static final String EVENT_EXPRESSION_LIST_CHANGED
Indication that the expression list has changed.
Constructor Detail

MultipleConditionalExpression

public MultipleConditionalExpression()
Method Detail

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

getExpressionCount

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

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

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:
UnsupportedOperationException - if the set method is not supported by this list.
ClassCastException - if the class of the specified element prevents it from being added to this list.
NullPointerException - if the specified element is null and this list does not support null elements.
IllegalArgumentException - if some aspect of the specified element prevents it from being added to this list.
IndexOutOfBoundsException - if the index is out of range (index < 0 || index >= size()).

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:
ClassCastException - if the class of the specified element prevents it from being added to this list.
NullPointerException - if the specified element is null and this list does not support null elements.
IllegalArgumentException - if some aspect of the specified element prevents it from being added to this list.
IndexOutOfBoundsException - if the index is out of range (index < 0 || index > size()).

addExpression

public void addExpression(ExpressionInterface condExpr)
Appends the expression in the list
Parameters:
condExpr - the expression that is added to this MultipleConditionalExpression.
Throws:
ClassCastException - if the class of the specified element prevents it from being added to this list.
NullPointerException - if the specified element is null and this list does not support null elements.
IllegalArgumentException - if some aspect of this element prevents it from being added to this list.

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:
IndexOutOfBoundsException - if the index is out of range (index < 0 || index >= size()).

clearExpressions

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

getExpression

public ExpressionInterface getExpression(int index)
Gets the expression in the list at the index
Parameters:
index -  
Returns:
the expression at the index
Throws:
IndexOutOfBoundsException - if the index is out of range (index < 0 || index >= size()).

getExpressions

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

getExpressionList

public List getExpressionList()
Gets a copy of the List of all the expressions
Returns:
List of the expressions

setExpressionList

public void setExpressionList(List values)
Sets the list of expressions Each value in the list must be of type ExpressionInterface
Parameters:
values - a list of ExpressionInterfaces.
Throws:
ClassCastException - if the class of an element in the specified collection prevents it from being added to this list.
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.
IllegalArgumentException - if some aspect of an element in the specified collection prevents it from being added to this list.

getValidExpressionTypes

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

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




Copyright © 2005 SAS Institute Inc. All Rights Reserved.
javadoc generated Fri, 10 Feb 2006 16:04:11