Class RWViewLimitHelper
- java.lang.Object
-
- com.microstrategy.web.objects.RWViewLimitHelper
-
- All Implemented Interfaces:
WebExpressionHelper
,WebLimitExpressionHelper
public class RWViewLimitHelper extends java.lang.Object implements WebLimitExpressionHelper
A subclass of the WebExpressionHelper that provides special functionality for editing limit expressions.- Since:
- MicroStrategy Web 9.0.1
-
-
Constructor Summary
Constructors Constructor Description RWViewLimitHelper(WebViewInstance ri, WebExpression owner)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addUnitLimit(WebNode node)
boolean
canEditExpression()
boolean
canGroup(int firstKey, int secondKey)
Check whether it is possible to call group() on the two nodes with the given keys.boolean
canGroup(WebNode firstNode, WebNode secondNode)
Check whether it is possible to call group() on the two given nodes.boolean
canSwapWithNext(int nodeKey)
Checks whether it is possible to call swapWithNext() on the node with the given key.boolean
canSwapWithNext(WebNode node)
Checks whether it is possible to call swapWithNext() on the given node.boolean
canSwapWithPrevious(int nodeKey)
Checks whether it is possible to call swapWithPrevious() on the node with the given key.boolean
canSwapWithPrevious(WebNode node)
Checks whether it is possible to call swapWithPrevious() on the given node.boolean
canUngroup(int firstKey, int secondKey)
Check whether it is possible to call ungroup() on the two nodes with the given keys.boolean
canUngroup(WebNode firstNode, WebNode secondNode)
Check whether it is possible to call ungroup() on the two given nodes.boolean
compareTo(WebExpression anotherExp)
Compares two WebExpression.void
consolidateTree()
Consolidates the whole expression tree.protected void
consolidateUnitLimit(com.microstrategy.web.objects.WebExpressionImpl unitLimit)
void
delete(int nodeKey)
Delete the node with the given key from the expression.void
delete(WebNode node)
Delete the specified node from the expression.protected WebNode
findSecondSwapNode(WebNode node)
protected com.microstrategy.web.objects.WebObjectInfoImpl
findTarget(WebNode node)
WebNode
findUnitNode(java.lang.String unitId)
Finds a root node of the unit limit expressionboolean
getAutoConsolidation()
Return the current setting for the auto-consolidation option.WebOperatorNode
getNewRootNode()
Creates a new root node for the specifiedWebExpression
.java.lang.String
getNodeGroupId(WebNode node)
Returns limit group ID of the given nodeint
getNodeLimitType(WebNode node)
Returns limit typeEnumWebLimitSummaryFlags
of the given nodejava.lang.String
getNodeUnitId(WebNode node)
Returns unit ID of the given nodeprotected com.microstrategy.web.objects.WebObjectInfoImpl
getTarget(WebNode node)
WebNode
getUnitNode(WebNode node)
Gets a root node of the unit limit expression for a given expression nodeWebNode
group(int firstKey, int secondKey)
Group two nodes in the expression together.WebNode
group(WebNode firstNode, WebNode secondNode)
Group two nodes in the expression together.boolean
hasFilterOn(WebObjectInfo oi)
Returns whether the expression contains an qualification on specified objectboolean
hasUnussignedPrompts(WebNode node)
Returns true if the given node contains unresolved prompts.boolean
isEqual(WebNode n1, WebNode n2)
Checks whether two WebNode are equal.WebExpression
removeEmptyFilters()
This method will take the current expression tree and attempt to remove any empty filters in the expression.void
removeLimits()
void
removeUnitLimit(java.lang.String unitId)
void
replaceUnitLimit(WebNode node)
void
replaceUnitLimit(WebNode node, boolean blockAutoSync)
void
setAutoConsolidation(boolean auto)
Sets the auto-consolidation option on this instance.void
setNodeLimitInfo(WebNode node, java.lang.String unitId)
void
swap(int firstKey, int secondKey)
Swap two nodes in the expression.void
swap(WebNode firstNode, WebNode secondNode)
Swap two nodes in the expression.void
swapWithNext(int nodeKey)
Swaps the node with the given key with its next sibling.void
swapWithNext(WebNode node)
Swap with next sibling.void
swapWithPrevious(int nodeKey)
Swaps the node with the given key with the previous sibling.void
swapWithPrevious(WebNode node)
Swap with previous sibling.void
toggleFunction(int firstKey, int secondKey, int toggleFunction)
Change the function between the two nodes with the given keys to the specified function.void
toggleFunction(WebNode firstNode, WebNode secondNode, int toggleFunction)
Change the function between the two given nodes to the specified function.void
ungroup(int firstKey, int secondKey)
Ungroup two nodes in the expression.void
ungroup(WebNode firstNode, WebNode secondNode)
Ungroup two nodes in the expression.boolean
validateOperands(WebNode node, RWDataSet ds)
Returns whether the given node and its children are valid.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.microstrategy.web.objects.WebExpressionHelper
canEditExpression, canGroup, canSwapWithNext, canSwapWithPrevious, canUngroup, compareTo, consolidateTree, delete, delete, getAutoConsolidation, getNewRootNode, group, group, hasFilterOn, isEqual, removeEmptyFilters, setAutoConsolidation, swap, swap, swapWithNext, swapWithNext, swapWithPrevious, swapWithPrevious, toggleFunction, toggleFunction, ungroup, ungroup, validateOperands
-
-
-
-
Constructor Detail
-
RWViewLimitHelper
public RWViewLimitHelper(WebViewInstance ri, WebExpression owner)
-
-
Method Detail
-
setNodeLimitInfo
public void setNodeLimitInfo(WebNode node, java.lang.String unitId)
-
addUnitLimit
public void addUnitLimit(WebNode node) throws WebObjectsException
- Specified by:
addUnitLimit
in interfaceWebLimitExpressionHelper
- Throws:
WebObjectsException
-
consolidateUnitLimit
protected void consolidateUnitLimit(com.microstrategy.web.objects.WebExpressionImpl unitLimit)
-
replaceUnitLimit
public void replaceUnitLimit(WebNode node)
- Specified by:
replaceUnitLimit
in interfaceWebLimitExpressionHelper
-
replaceUnitLimit
public void replaceUnitLimit(WebNode node, boolean blockAutoSync)
-
removeUnitLimit
public void removeUnitLimit(java.lang.String unitId)
- Specified by:
removeUnitLimit
in interfaceWebLimitExpressionHelper
-
removeLimits
public void removeLimits()
- Specified by:
removeLimits
in interfaceWebLimitExpressionHelper
-
getUnitNode
public WebNode getUnitNode(WebNode node)
Gets a root node of the unit limit expression for a given expression node- Specified by:
getUnitNode
in interfaceWebLimitExpressionHelper
- Parameters:
node
- expression node- Returns:
- node
-
findUnitNode
public WebNode findUnitNode(java.lang.String unitId)
Finds a root node of the unit limit expression- Specified by:
findUnitNode
in interfaceWebLimitExpressionHelper
- Parameters:
unitId
- an ID of the working set unit- Returns:
- node or null
-
getNodeUnitId
public java.lang.String getNodeUnitId(WebNode node)
Returns unit ID of the given node- Specified by:
getNodeUnitId
in interfaceWebLimitExpressionHelper
- Parameters:
node
- node- Returns:
- unit ID
-
getNodeGroupId
public java.lang.String getNodeGroupId(WebNode node)
Returns limit group ID of the given node- Specified by:
getNodeGroupId
in interfaceWebLimitExpressionHelper
- Parameters:
node
- node- Returns:
- group ID
-
getNodeLimitType
public int getNodeLimitType(WebNode node)
Returns limit typeEnumWebLimitSummaryFlags
of the given node- Specified by:
getNodeLimitType
in interfaceWebLimitExpressionHelper
- Parameters:
node
- node- Returns:
- limit type
-
canUngroup
public boolean canUngroup(WebNode firstNode, WebNode secondNode) throws java.lang.IllegalArgumentException
Description copied from interface:WebExpressionHelper
Check whether it is possible to call ungroup() on the two given nodes.- Specified by:
canUngroup
in interfaceWebExpressionHelper
- Parameters:
firstNode
- The first node.secondNode
- The second node.- Returns:
- True if calling ungroup() on the two given nodes will not cause an error, or false if it is not possible to ungroup the two given nodes.
- Throws:
java.lang.IllegalArgumentException
- Thrown if either input parameter is null.
-
canGroup
public boolean canGroup(WebNode firstNode, WebNode secondNode) throws java.lang.IllegalArgumentException
Description copied from interface:WebExpressionHelper
Check whether it is possible to call group() on the two given nodes.- Specified by:
canGroup
in interfaceWebExpressionHelper
- Parameters:
firstNode
- The first node.secondNode
- The second node.- Returns:
- True if calling group() on the two given nodes will not cause an error, or false if it is not possible to group the two given nodes.
- Throws:
java.lang.IllegalArgumentException
- Thrown if either input parameter is null.
-
canSwapWithNext
public boolean canSwapWithNext(WebNode node) throws java.lang.IllegalArgumentException
Description copied from interface:WebExpressionHelper
Checks whether it is possible to call swapWithNext() on the given node.- Specified by:
canSwapWithNext
in interfaceWebExpressionHelper
- Parameters:
node
- The node to be swapped.- Returns:
- True if swapWithNext will not cause an error, false otherwise.
- Throws:
java.lang.IllegalArgumentException
- Thrown if the node parameter is null.
-
canSwapWithPrevious
public boolean canSwapWithPrevious(WebNode node) throws java.lang.IllegalArgumentException
Description copied from interface:WebExpressionHelper
Checks whether it is possible to call swapWithPrevious() on the given node.- Specified by:
canSwapWithPrevious
in interfaceWebExpressionHelper
- Parameters:
node
- The node to be swapped.- Returns:
- True if swapWithPrevious will not cause an error, false otherwise.
- Throws:
java.lang.IllegalArgumentException
- Thrown if the node parameter is null.
-
findTarget
protected com.microstrategy.web.objects.WebObjectInfoImpl findTarget(WebNode node)
-
getTarget
protected com.microstrategy.web.objects.WebObjectInfoImpl getTarget(WebNode node)
-
hasUnussignedPrompts
public boolean hasUnussignedPrompts(WebNode node)
Returns true if the given node contains unresolved prompts. In this case we don't know what unit to ussign this limit to.- Specified by:
hasUnussignedPrompts
in interfaceWebLimitExpressionHelper
- Parameters:
node
-
-
getAutoConsolidation
public boolean getAutoConsolidation()
Description copied from interface:WebExpressionHelper
Return the current setting for the auto-consolidation option. When the auto-consolidation setting is on, a consolidation of the expression tree will be done after every other manipulation on this interface. See the consolidateTree method for the effects of a consolidation operation. By default, this option is true.- Specified by:
getAutoConsolidation
in interfaceWebExpressionHelper
- Returns:
- The current setting for auto-consolidation.
- See Also:
WebExpressionHelper.setAutoConsolidation(boolean)
,WebExpressionHelper.consolidateTree()
-
setAutoConsolidation
public void setAutoConsolidation(boolean auto)
Description copied from interface:WebExpressionHelper
Sets the auto-consolidation option on this instance. When the auto-consolidation setting is on, a consolidation of the expression tree will be done after every other manipulation on this interface. See the consolidateTree method for the effects of a consolidation operation.- Specified by:
setAutoConsolidation
in interfaceWebExpressionHelper
- Parameters:
auto
- The desired setting for auto-consolidation.- See Also:
WebExpressionHelper.getAutoConsolidation()
,WebExpressionHelper.consolidateTree()
-
consolidateTree
public void consolidateTree()
Description copied from interface:WebExpressionHelper
Consolidates the whole expression tree.Consolidation rules:
- Any branch qualification (AND, OR, or NOT) which has no child nodes will be removed.
- Branch qualifications (AND, OR), which have 1 child node will be removed and the tree adjusted such that the expression's meaning will not be changed.
- If a NOT node has a NOT node as it's child node, both not nodes will be removed.
- Any AND or OR node, can not have its first child as NOT node,
- If the first child is a NOT node,
- if there is at least one non-NOT child, try to swap with the first non-NOT child
- else, create a NOT node, move current AND or OR node under the NOT node, then change the AND to OR, OR to AND, then replace all NOT children with their children. Eg. (NOT A AND NOT B) -> NOT (A OR B)
- If the first child is a NOT node,
- Specified by:
consolidateTree
in interfaceWebExpressionHelper
-
group
public WebNode group(WebNode firstNode, WebNode secondNode) throws java.lang.IllegalArgumentException, WebObjectsException
Description copied from interface:WebExpressionHelper
Group two nodes in the expression together. The two nodes given must either share a parent node or for the first node and the parent node of the second child (which must be a NOT node) share a common parent node. In the second case, the operator will be considered to be the parent and the not node combined(i.e. AND NOT or OR NOT). This method will create a new node, which will have the same function (AND or OR) as the original parent of these two nodes. The new node is inserted at the position of the first given node, and the two given nodes will be set as child nodes of the newly created node.- Specified by:
group
in interfaceWebExpressionHelper
- Parameters:
firstNode
- The first input parameter, which must share a parent with secondNodesecondNode
- The second input parameter, which must either share a parent with firstNode or the parent node must be a NOT node, and that node must share a parent with the firstNode.- Returns:
- The new parent node of the two given nodes.
- Throws:
java.lang.IllegalArgumentException
- Thrown if either input parameter is null.WebObjectsException
- Thrown when the parent of one child is not a branch qualification operator, when these children do not share the same parent, or when one of the input nodes is the root node of the expression.
-
group
public WebNode group(int firstKey, int secondKey) throws java.lang.IllegalArgumentException, WebObjectsException
Description copied from interface:WebExpressionHelper
Group two nodes in the expression together. This method is used to identify the nodes by the key of the expression. The two nodes given must either share a parent node or for the first node and the parent node of the second child (which must be a NOT node) share a common parent node. In the second case, the operator will be considered to be the parent and the not node combined(i.e. AND NOT or OR NOT). This method will create a new node, which will have the same function (AND or OR) as the original parent of these two nodes. The new node is inserted at the position of the first given node, and the two given nodes will be set as child nodes of the newly created node.- Specified by:
group
in interfaceWebExpressionHelper
- Parameters:
firstKey
- The key of the first node.secondKey
- The key of the second node. the parent node must be a NOT node, and that node must share a parent with the firstNode.- Returns:
- The new parent node of the two given nodes.
- Throws:
java.lang.IllegalArgumentException
- Thrown if either input parameter is null.WebObjectsException
- Thrown when the parent of one child is not a branch qualification operator, when these children do not share the same parent, or when one of the input nodes is the root node of the expression.
-
ungroup
public void ungroup(WebNode firstNode, WebNode secondNode) throws java.lang.IllegalArgumentException, WebObjectsException
Description copied from interface:WebExpressionHelper
Ungroup two nodes in the expression. The parent of both given nodes, which is an operator node, will be removed and the two child nodes will be moved to the removed node's position in the expression. The two nodes given must either share a parent node or for the first node and the parent node of the second child (which must be a NOT node) share a common parent node. In the second case, the operator will be considered to be the parent and the not node combined(i.e. AND NOT or OR NOT).- Specified by:
ungroup
in interfaceWebExpressionHelper
- Parameters:
firstNode
- The first node to be ungrouped.secondNode
- The second node to be ungrouped.- Throws:
java.lang.IllegalArgumentException
- Thrown when one of the input parameters is null.WebObjectsException
- Thrown when parent node of one of the given nodes is not a branch qualificaiton operator, when the given nodes do not share the same parent, or when one of the input nodes or the parent of the input nodes is the root node of the expression.
-
ungroup
public void ungroup(int firstKey, int secondKey) throws java.lang.IllegalArgumentException, WebObjectsException
Description copied from interface:WebExpressionHelper
Ungroup two nodes in the expression. This method allows the user to specify the nodes to be ungrouped by their keys. The parent of both given nodes, which is an operator node, will be removed and the two child nodes will be moved to the removed node's position in the expression. The two nodes given must either share a parent node or for the first node and the parent node of the second child (which must be a NOT node) share a common parent node. In the second case, the operator will be considered to be the parent and the not node combined(i.e. AND NOT or OR NOT).- Specified by:
ungroup
in interfaceWebExpressionHelper
- Parameters:
firstKey
- The key of first node to be ungrouped.secondKey
- The key of second node to be ungrouped.- Throws:
java.lang.IllegalArgumentException
- Thrown when one of the input parameters is null.WebObjectsException
- Thrown when parent node of one of the given nodes is not a branch qualificaiton operator, when the given nodes do not share the same parent, or when one of the input nodes or the parent of the input nodes is the root node of the expression.
-
swap
public void swap(WebNode firstNode, WebNode secondNode) throws java.lang.IllegalArgumentException
Description copied from interface:WebExpressionHelper
Swap two nodes in the expression. These two nodes can be anywhere in the expression tree. After calling this method, the two nodes' locations will be swapped.- Specified by:
swap
in interfaceWebExpressionHelper
- Parameters:
firstNode
- The first node to be swapped.secondNode
- The second node to be swapped.- Throws:
java.lang.IllegalArgumentException
- Thrown when the input parameter is null.
-
swap
public void swap(int firstKey, int secondKey) throws java.lang.IllegalArgumentException
Description copied from interface:WebExpressionHelper
Swap two nodes in the expression. These two nodes can be anywhere in the expression tree. After calling this method, the two nodes' locations will be swapped.- Specified by:
swap
in interfaceWebExpressionHelper
- Parameters:
firstKey
- The key of the first node to be swapped.secondKey
- The key of the second node to be swapped.- Throws:
java.lang.IllegalArgumentException
- Thrown when one of the keys do not exist in the expression tree.
-
swapWithPrevious
public void swapWithPrevious(WebNode node) throws java.lang.IllegalArgumentException, WebObjectsException
Swap with previous sibling. If the node is the first child, it can not be moved forward further. Exception: If parent node is NOT node, swap with the NOT's previous sibling If previous sibling is NOT node, swap with its child- Specified by:
swapWithPrevious
in interfaceWebExpressionHelper
- Parameters:
node
- The node to be swapped.- Throws:
java.lang.IllegalArgumentException
- Thrown when the input parameter is null.WebObjectsException
- Thrown if the parent of the given node is not a branch qualification operator or when there is no previous sibling to swap with.
-
swapWithPrevious
public void swapWithPrevious(int nodeKey) throws java.lang.IllegalArgumentException, WebObjectsException
Description copied from interface:WebExpressionHelper
Swaps the node with the given key with the previous sibling. This only works if the given node is not the first child of it's parent node.There are two special cases:
- If the parent node is a NOT node, swap the given node with the NOT node's previous sibling.
- If the previous sibling is a NOT node, swap the given node with its child.
- Specified by:
swapWithPrevious
in interfaceWebExpressionHelper
- Parameters:
nodeKey
- The key of the node to be swapped.- Throws:
java.lang.IllegalArgumentException
- Thrown if no node with the given key exists.WebObjectsException
- Thrown if the parent of the given node is not a branch qualification operator or when there is no previous sibling to swap with.
-
swapWithNext
public void swapWithNext(WebNode node) throws java.lang.IllegalArgumentException, WebObjectsException
Swap with next sibling. If the node is the last child, it can not be moved backward further. Exception: If parent node is NOT node, swap with the NOT's next sibling If next sibling is NOT node, swap with its child- Specified by:
swapWithNext
in interfaceWebExpressionHelper
- Parameters:
node
- The node to be swapped.- Throws:
java.lang.IllegalArgumentException
- Thrown when the input parameter is null.WebObjectsException
- Thrown if the parent of the given node is not a branch qualification operator or when there is no previous sibling to swap with.
-
findSecondSwapNode
protected WebNode findSecondSwapNode(WebNode node) throws WebObjectsException
- Throws:
WebObjectsException
- Since:
- MicroStrategy Web 8.0.2
-
swapWithNext
public void swapWithNext(int nodeKey) throws java.lang.IllegalArgumentException, WebObjectsException
Description copied from interface:WebExpressionHelper
Swaps the node with the given key with its next sibling. This only works if the given node is not the last child of it's parent node.There are two special cases:
- If the parent node is a NOT node, swap the given node with the NOT node's next sibling.
- If the next sibling is a NOT node, swap the given node with its child.
- Specified by:
swapWithNext
in interfaceWebExpressionHelper
- Parameters:
nodeKey
- The key of the node to be swapped.- Throws:
java.lang.IllegalArgumentException
- Thrown if no node with the given key exists.WebObjectsException
- Thrown if the parent of the given node is not a branch qualification operator or when there is no previous sibling to swap with.
-
toggleFunction
public void toggleFunction(int firstKey, int secondKey, int toggleFunction) throws java.lang.IllegalArgumentException, WebObjectsException
Description copied from interface:WebExpressionHelper
Change the function between the two nodes with the given keys to the specified function. The functions which are available come fromEnumWebToggleFunction
. Note that if AND NOT or OR NOT are the original operator, the node directly under the NOT node should be specified as the second argument to this method. These two nodes either should be the direct children of the same parent, or the second node must have a NOT node as its parent which shares a parent with the first argument.For example, if there were an AND node, with children firstNode and a NOT node which has the secondNode as a child node, then the original function is considered to be AND NOT.
Each time, this function will add a new node for the new toggleFunction first. Then if the auto consolidation is set, it may remove the original function node (the shared parent of the two input nodes).
- Specified by:
toggleFunction
in interfaceWebExpressionHelper
- Parameters:
firstKey
- The key of the first node whose parent operator will be toggled.secondKey
- The key of the second node whose parent operator will be toggled.toggleFunction
- The function to toggle to, which is a value fromEnumWebToggleFunction
.- Throws:
java.lang.IllegalArgumentException
- Thrown if one of the keys given is not found in the expression.WebObjectsException
- Thrown if the parent of the given nodes is not aa branch qualification operator, the two given nodes do not share the same parent, or if either the first node, second node, or the shared parent node are the root node of the expression.- See Also:
WebExpressionHelper.consolidateTree()
-
toggleFunction
public void toggleFunction(WebNode firstNode, WebNode secondNode, int toggleFunction) throws java.lang.IllegalArgumentException, WebObjectsException
Description copied from interface:WebExpressionHelper
Change the function between the two given nodes to the specified function. The functions which are available come fromEnumWebToggleFunction
. Note that if AND NOT or OR NOT are the original operator, the node directly under the NOT node should be specified as the second argument to this method. These two nodes either should be the direct children of the same parent, or the second node must have a NOT node as its parent which shares a parent with the first argument.For example, if there were an AND node, with children firstNode and a NOT node which has the secondNode as a child node, then the original function is considered to be AND NOT.
Each time, this function will add a new node for the new toggleFunction first. Then if the auto consolidation is set, it may remove the original function node (the shared parent of the two input nodes).
- Specified by:
toggleFunction
in interfaceWebExpressionHelper
- Parameters:
firstNode
- The first node whose parent operator will be toggled.secondNode
- The second node whose parent operator will be toggled.toggleFunction
- The function to toggle to, which is a value fromEnumWebToggleFunction
.- Throws:
java.lang.IllegalArgumentException
- Thrown when input parameter is null.WebObjectsException
- Thrown if the parent of the given nodes is not aa branch qualification operator, the two given nodes do not share the same parent, or if either the first node, second node, or the shared parent node are the root node of the expression.- See Also:
WebExpressionHelper.consolidateTree()
-
delete
public void delete(WebNode node) throws java.lang.IllegalArgumentException
Description copied from interface:WebExpressionHelper
Delete the specified node from the expression. If it is the root node of the expression, this method will do nothing.- Specified by:
delete
in interfaceWebExpressionHelper
- Parameters:
node
- The node to be deleted.- Throws:
java.lang.IllegalArgumentException
- Thrown if the input parameter is null.
-
delete
public void delete(int nodeKey) throws java.lang.IllegalArgumentException
Description copied from interface:WebExpressionHelper
Delete the node with the given key from the expression. If it is the root node of the expression, this method will do nothing.- Specified by:
delete
in interfaceWebExpressionHelper
- Parameters:
nodeKey
- The key of the node to be deleted.- Throws:
java.lang.IllegalArgumentException
- Thrown if the key is not found in the expression.
-
canGroup
public boolean canGroup(int firstKey, int secondKey) throws java.lang.IllegalArgumentException
Description copied from interface:WebExpressionHelper
Check whether it is possible to call group() on the two nodes with the given keys.- Specified by:
canGroup
in interfaceWebExpressionHelper
- Parameters:
firstKey
- The key of the first node.secondKey
- The key of the second node.- Returns:
- True if calling group() on the two given nodes will not cause an error, or false if it is not possible to group the two given nodes.
- Throws:
java.lang.IllegalArgumentException
- Thrown if either key does not exist in the expression.
-
canUngroup
public boolean canUngroup(int firstKey, int secondKey) throws java.lang.IllegalArgumentException
Description copied from interface:WebExpressionHelper
Check whether it is possible to call ungroup() on the two nodes with the given keys.- Specified by:
canUngroup
in interfaceWebExpressionHelper
- Parameters:
firstKey
- The key of the first node.secondKey
- The key of the second node.- Returns:
- True if calling ungroup() on the two given nodes will not cause an error, or false if it is not possible to ungroup the two given nodes.
- Throws:
java.lang.IllegalArgumentException
- Thrown if either key does not exist in the expression.
-
canSwapWithPrevious
public boolean canSwapWithPrevious(int nodeKey) throws java.lang.IllegalArgumentException
Description copied from interface:WebExpressionHelper
Checks whether it is possible to call swapWithPrevious() on the node with the given key.- Specified by:
canSwapWithPrevious
in interfaceWebExpressionHelper
- Parameters:
nodeKey
- The key of the node to be swapped.- Returns:
- True if swapWithPrevious will not cause an error, false otherwise.
- Throws:
java.lang.IllegalArgumentException
- Thrown if the node parameter is null.
-
canSwapWithNext
public boolean canSwapWithNext(int nodeKey) throws java.lang.IllegalArgumentException
Description copied from interface:WebExpressionHelper
Checks whether it is possible to call swapWithNext() on the node with the given key.- Specified by:
canSwapWithNext
in interfaceWebExpressionHelper
- Parameters:
nodeKey
- The key of the node to be swapped.- Returns:
- True if swapWithNext will not cause an error, false otherwise.
- Throws:
java.lang.IllegalArgumentException
- Thrown if the node parameter is null.
-
removeEmptyFilters
public WebExpression removeEmptyFilters()
Description copied from interface:WebExpressionHelper
This method will take the current expression tree and attempt to remove any empty filters in the expression. After doing that, it will consolidate the new expression. This method, if it is necessary to change the expresssion, will return a copy of the current expression; the expression that belongs to this WebExpressionHelper object will never be modified.- Specified by:
removeEmptyFilters
in interfaceWebExpressionHelper
- Returns:
- Either the current expression, if no change was needed, or a copy of the current expression that has empty filters removed and is consolidated.
- Since:
- MicroStrategy Web 8.0.1
-
canEditExpression
public boolean canEditExpression()
- Specified by:
canEditExpression
in interfaceWebExpressionHelper
-
getNewRootNode
public WebOperatorNode getNewRootNode()
Creates a new root node for the specifiedWebExpression
. The new root node has functionEnumDSSXMLFunction.DssXmlFunctionAnd
and expression typeEnumDSSXMLExpressionType.DssXmlFilterBranchQual
. If the specifiedWebExpression
has any sub expression originally, the sub expression becomes the first child of the new root node after the method call returns.- Specified by:
getNewRootNode
in interfaceWebExpressionHelper
- Returns:
- a new root node for the specified expression object.
-
hasFilterOn
public boolean hasFilterOn(WebObjectInfo oi)
Description copied from interface:WebExpressionHelper
Returns whether the expression contains an qualification on specified object- Specified by:
hasFilterOn
in interfaceWebExpressionHelper
-
compareTo
public boolean compareTo(WebExpression anotherExp)
Description copied from interface:WebExpressionHelper
Compares two WebExpression. The comparison is based on the structure of each root node in the expressions.Note that this method is currently used to compare the expressions which are used in derived elements editor.
- Specified by:
compareTo
in interfaceWebExpressionHelper
- Parameters:
anotherExp
- the WebExpression to be compared..- Returns:
- true if this expression is the same as the anotherExp argument; false otherwise.
- See Also:
WebExpressionHelper.isEqual(WebNode, WebNode)
-
isEqual
public boolean isEqual(WebNode n1, WebNode n2)
Description copied from interface:WebExpressionHelper
Checks whether two WebNode are equal.Note that this method is currently used to compare the expressions which are used in derived elements editor.
- Specified by:
isEqual
in interfaceWebExpressionHelper
- Parameters:
n1
- the first WebNode to check equalityn2
- the second WebNode to check equality- Returns:
- true if the two WebNode are the same; false otherwise.
-
validateOperands
public boolean validateOperands(WebNode node, RWDataSet ds)
Description copied from interface:WebExpressionHelper
Returns whether the given node and its children are valid. The primary use of this is to ensure that the given node is valid within the given RW context.- Specified by:
validateOperands
in interfaceWebExpressionHelper
- Parameters:
node
- TheWebNode
object which will be validated. If null is passed, then the validation will start at the root. Note that all children will be validated as well.ds
- The dataset which is used to validate if it contains the operand objects- Returns:
- True if the expression is valid, false if it is not.
-
-