com.sas.dataselectors.filters
Interface SimpleFilterLogicTreeInterface

All Known Implementing Classes:
SimpleFilterLogicTreeAdapter

public interface SimpleFilterLogicTreeInterface

The SimpleFilterLogicTreeInterface provides a simpler tree structure than the FilterLogicTreeInterface.


Field Summary
static java.lang.String AND
          Constant value used when defining or determining the logical relationship between two expressions in a filter.
static java.lang.String OR
          Constant value used when defining or determining the logical relationship between two expressions in a filter.
 
Method Summary
 void add(FilterLogicBaseNodeInterface rootNode)
          Appends the given logic tree structure to this one.
 void add(SimpleFilterLogicTreeInterface tree)
          Appends the given logic tree to this one.
 void addLeafAt(int index, FilterLogicTestNodeInterface testNode)
          Add a new test node at the given index in the list of understood test nodes.
 boolean areAllNodesUnderstood()
          Returns TRUE if all leaf nodes in the tree have been marked as "understood", FALSE otherwise.
 void cancel(java.lang.Object initialFilter)
          Returns the filter model to the state specified by the given filter object.
 boolean canGroupLeaves(int firstIndex, int lastIndex)
          Returns TRUE if the leaves (or the groups they're members of) at the given indices can be grouped together.
 void clear()
          Removes all leaves from the tree and collapses any remaining support structure.
 boolean commitTree()
          Commits any changes in the tree to the underlying native filter model.
 SimpleFilterLogicTreeInterface copy()
          Constructs and returns a copy of this tree.
 SimpleFilterLogicTreeInterface copy(boolean copyTestNodes)
          Copies the tree and optionally makes duplicates of the test nodes within it.
 FilterItemInterface findMatchingFilterItem(java.lang.Object itemObject)
          Attempts to locate and return the filter model object that matches the specified search item from the native model.
 int getFirstLeafInGroup(int memberIndex)
          Returns the index of the first leaf in the group that includes the leaf at the given index.
 int getLastLeafInGroup(int memberIndex)
          Returns the index of the last leaf in the group that includes the leaf at the given index.
 FilterLogicTestNodeInterface getLeafAt(int index)
          Returns the test node at the given index.
 java.lang.String getLeafConditionalRelationType(int index)
          Returns the conditional relation type (AND/OR) between the leaf at the given index and the leaf at the next index.
 FilterLogicBaseNodeInterface getRoot()
          Returns the root node of the logic tree.
 java.lang.Object getRootFilterItem()
          Returns the root native filter object.
 java.util.List getUnderstoodTestNodeList()
          Returns the list of understood nodes in the tree.
 void groupLeaves(int startIndex, int endIndex)
          Groups the leaves (including any groups they are members of) at the specified locations together (along with any nodes in between them).
 boolean isLeafGrouped(int index)
          Returns TRUE if the leaf at the given index is part of a group.
 boolean isLeafNegated(int index)
          Returns TRUE if the leaf at the given index or group that leaf is a member of is negated, FALSE otherwise.
 void moveLeafDown(int index)
          Moves the leaf at the given index down one.
 void moveLeafUp(int index)
          Moves the leaf at the given index up one.
 void refreshNodeList()
          Refreshes the list of leaf nodes in the tree.
 FilterLogicTestNodeInterface removeLeafAt(int index)
          Removes the test node at the given index.
 FilterLogicTestNodeInterface setLeafAt(int index, FilterLogicTestNodeInterface testNode)
          Sets the test node at the given index in the list of understood test nodes.
 void setLeafConditionalRelationType(int index, java.lang.String value)
          Sets the logical relationship between the leaf at the given index and the leaf at the next index.
 void setLeafNegated(int index, boolean value)
          Sets whether the leaf at the given index or group that leaf is a member of is negated.
 FilterLogicBaseNodeInterface setRoot(FilterLogicBaseNodeInterface root)
          Sets the root tree node for this tree.
 void splitGroup(int indexOfMember)
          Splits the inner-most group containing the member at the specified index.
 

Field Detail

AND

static final java.lang.String AND
Constant value used when defining or determining the logical relationship between two expressions in a filter. This value represents the boolean AND relationship.

See Also:
Constant Field Values

OR

static final java.lang.String OR
Constant value used when defining or determining the logical relationship between two expressions in a filter. This value represents the boolean OR relationship.

See Also:
Constant Field Values
Method Detail

addLeafAt

void addLeafAt(int index,
               FilterLogicTestNodeInterface testNode)
Add a new test node at the given index in the list of understood test nodes. The new node will be inserted at the new index.

Parameters:
index - the index in the list at which the new node will be inserted
testNode - the new node to add

setLeafAt

FilterLogicTestNodeInterface setLeafAt(int index,
                                       FilterLogicTestNodeInterface testNode)
Sets the test node at the given index in the list of understood test nodes.

Parameters:
index - the index in the list at which the new node will be set
testNode - the new node to put at the given index
Returns:
the old test node

removeLeafAt

FilterLogicTestNodeInterface removeLeafAt(int index)
Removes the test node at the given index.

Parameters:
index - the index of the test node, in the list of understood nodes, to be removed
Returns:
the removed node

getLeafAt

FilterLogicTestNodeInterface getLeafAt(int index)
Returns the test node at the given index.

Parameters:
index - the index of the desired test node
Returns:
the test node at the specified index

getRoot

FilterLogicBaseNodeInterface getRoot()
Returns the root node of the logic tree.

Returns:
the root node of the tree

refreshNodeList

void refreshNodeList()
Refreshes the list of leaf nodes in the tree.


areAllNodesUnderstood

boolean areAllNodesUnderstood()
Returns TRUE if all leaf nodes in the tree have been marked as "understood", FALSE otherwise.

Returns:
true if all nodes are understood

getUnderstoodTestNodeList

java.util.List getUnderstoodTestNodeList()
Returns the list of understood nodes in the tree. This list can be used to present the structure of the filter logic in a simple, flat list.

Returns:
the list of understood nodes

commitTree

boolean commitTree()
Commits any changes in the tree to the underlying native filter model.

Returns:
TRUE if the native filter model was updated successfully, FALSE otherwise

cancel

void cancel(java.lang.Object initialFilter)
Returns the filter model to the state specified by the given filter object.

Parameters:
initialFilter - the initial filter state to return to

findMatchingFilterItem

FilterItemInterface findMatchingFilterItem(java.lang.Object itemObject)
Attempts to locate and return the filter model object that matches the specified search item from the native model.

Parameters:
itemObject - the search item
Returns:
the matching filter item or null if none was found

getRootFilterItem

java.lang.Object getRootFilterItem()
Returns the root native filter object.

Returns:
the root native filter object

isLeafNegated

boolean isLeafNegated(int index)
Returns TRUE if the leaf at the given index or group that leaf is a member of is negated, FALSE otherwise.

Parameters:
the - index in the list of understood test nodes
Returns:
TRUE if the leaf is negated, FALSE otherwise

setLeafNegated

void setLeafNegated(int index,
                    boolean value)
Sets whether the leaf at the given index or group that leaf is a member of is negated.

Parameters:
the - index in the list of understood test nodes
value - the new negation value

getLeafConditionalRelationType

java.lang.String getLeafConditionalRelationType(int index)
Returns the conditional relation type (AND/OR) between the leaf at the given index and the leaf at the next index.

Returns:
the logical relationship between the leaf at the given index and the leaf at the next index

setLeafConditionalRelationType

void setLeafConditionalRelationType(int index,
                                    java.lang.String value)
Sets the logical relationship between the leaf at the given index and the leaf at the next index. Valid values are "AND" and "OR".

Parameters:
index - the index of the first leaf in the pair
value - the logical condition

splitGroup

void splitGroup(int indexOfMember)
Splits the inner-most group containing the member at the specified index.

Parameters:
indexOfMember - the index of the member of the group to split

groupLeaves

void groupLeaves(int startIndex,
                 int endIndex)
Groups the leaves (including any groups they are members of) at the specified locations together (along with any nodes in between them).

Parameters:
startIndex - the start of the new group
endIndex - the end of the new group

moveLeafUp

void moveLeafUp(int index)
Moves the leaf at the given index up one. If the leaf is the first member of a group, the entire group will move up.

Parameters:
index - the index of the leaf to move

moveLeafDown

void moveLeafDown(int index)
Moves the leaf at the given index down one. If the leaf is the last member of a group, the entire group will move down.

Parameters:
index - the index of the leaf to move

isLeafGrouped

boolean isLeafGrouped(int index)
Returns TRUE if the leaf at the given index is part of a group.

Parameters:
index - the index in the list of understood nodes of the leaf to check
Returns:
boolean TRUE if the leaf is part of a group, FALSE otherwise.

clear

void clear()
Removes all leaves from the tree and collapses any remaining support structure.


getFirstLeafInGroup

int getFirstLeafInGroup(int memberIndex)
Returns the index of the first leaf in the group that includes the leaf at the given index.

Parameters:
memberIndex - the index of the node that is a member of the group to return the index of its first leaf
Returns:
-1 if ungrouped, otherwise the index of the first leaf in the specified group

getLastLeafInGroup

int getLastLeafInGroup(int memberIndex)
Returns the index of the last leaf in the group that includes the leaf at the given index.

Parameters:
memberIndex - the index of the node that is a member of the group to return the index of its last leaf
Returns:
-1 if ungrouped, otherwise the index of the last leaf in the specified group

canGroupLeaves

boolean canGroupLeaves(int firstIndex,
                       int lastIndex)
Returns TRUE if the leaves (or the groups they're members of) at the given indices can be grouped together.

Parameters:
firstIndex - the index of the first leaf selected
lastIndex - the index of the last leaf selected
Returns:
TRUE if the leaves (or the groups they're members of) at the given indices can be grouped together.

copy

SimpleFilterLogicTreeInterface copy()
Constructs and returns a copy of this tree.

Returns:
the duplicate logic tree

copy

SimpleFilterLogicTreeInterface copy(boolean copyTestNodes)
Copies the tree and optionally makes duplicates of the test nodes within it.

Parameters:
copyTestNodes - TRUE if the test nodes in this tree should be duplicated
Returns:
A new tree

setRoot

FilterLogicBaseNodeInterface setRoot(FilterLogicBaseNodeInterface root)
Sets the root tree node for this tree.

Parameters:
root - the new root node of the tree
Returns:
the old root node or null if none existed

add

void add(SimpleFilterLogicTreeInterface tree)
Appends the given logic tree to this one.

Parameters:
tree - the tree to add

add

void add(FilterLogicBaseNodeInterface rootNode)
Appends the given logic tree structure to this one.

Parameters:
rootNode -



Copyright © 2009 SAS Institute Inc. All Rights Reserved.