com.sap.mdm.search
Class SearchGroup

java.lang.Object
  extended bycom.sap.mdm.search.SearchGroup
All Implemented Interfaces:
Cloneable, SearchItem
Direct Known Subclasses:
Search

public class SearchGroup
extends Object
implements SearchItem, Cloneable

A search group is a container for a list of search parameters.

Note: There are many limitations as to how a search can be setup when using search groups. Below is a list of some limitations. It is by no mean a complete list. In the examples, an upper case indicates a search dimension on a field and a lowercase indicates a search constraint.

1. At most one level of nesting is allowed.
For examples:

 A=a && B=b && C=c                // no nesting, OK
 (A=a || A=b) &&(C=c)             // one level nesting, OK
 ((A=a || A=b) && (C=c)) && (D=d) // two or more level nesting, not OK
 
2. All field dimensions within a search group needs to be the same field dimension.
For examples:
 (A=a || A=b) // OK
 (A=a || B=b) // not OK
 
3. Depending on what the main level search operator (setComparisonOperator(int)) is set to, the search group operator (setComparisonOperator(int)) is limited.
Search.setComparisonOperator Operator Between Search Groups SearchGroup.setComparisonOperator
Search.STANDARD_OPERATOR AND SearchGroup.OR_OPERATOR or SearchGroup.AND_OPERATOR
Search.AND_OPERATOR AND SearchGroup.AND_OPERATOR
Search.OR_OPERATOR OR SearchGroup.OR_OPERATOR

4. Support for qualifiers will NOT work for something like:
 (A=a || A=b) && (A=c || A=d)
 

5. MaskSearchDimension, NamedSearchSearchDimension and KeywordSearchDimension cannot be added to a search group.

6. A Search within a Search or within a SearchGroup.

See Also:
SearchDimension

Field Summary
static int AND_OPERATOR
          Specifies an AND operation for operands on the same level.
static int OR_OPERATOR
          Specifies an OR operation for operands on the same level.
static int STANDARD_OPERATOR
          Deprecated. replaced by Search.STANDARD_OPERATOR
 
Fields inherited from interface com.sap.mdm.search.SearchItem
SEARCH, SEARCH_GROUP, SEARCH_PARAMETER
 
Constructor Summary
SearchGroup()
          The empty constructor.
 
Method Summary
 SearchItem addSearchItem(SearchDimension dimension, SearchConstraint constraint)
          Adds a search item.
 SearchItem addSearchItem(SearchItem searchItem)
          Adds a search item to the search group.
 void clear()
          Removes all search items from the list
 Object clone()
          Clones this object.
 boolean equals(Object obj)
           
 int getComparisonOperator()
          Returns the logical operator for the search group.
 SearchItem getSearchItem(int index)
          Returns the search item.
 SearchItem[] getSearchItems()
          Returns the list of search items.
 int getType()
          Returns the search item type.
 int hashCode()
           
 SearchItem removeSearchItem(int index)
          Removes the search item from the list.
 void setComparisonOperator(int operator)
          Sets the logical operator.
 String toString()
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

STANDARD_OPERATOR

public static final int STANDARD_OPERATOR
Deprecated. replaced by Search.STANDARD_OPERATOR

See Also:
Constant Field Values

OR_OPERATOR

public static final int OR_OPERATOR
Specifies an OR operation for operands on the same level.

See Also:
Constant Field Values

AND_OPERATOR

public static final int AND_OPERATOR
Specifies an AND operation for operands on the same level.

See Also:
Constant Field Values
Constructor Detail

SearchGroup

public SearchGroup()
The empty constructor.

Method Detail

clone

public Object clone()
Description copied from interface: SearchItem
Clones this object.

Specified by:
clone in interface SearchItem

equals

public boolean equals(Object obj)

hashCode

public int hashCode()

toString

public String toString()

getType

public int getType()
Description copied from interface: SearchItem
Returns the search item type.

Specified by:
getType in interface SearchItem
Returns:
the search item type

getComparisonOperator

public int getComparisonOperator()
Returns the logical operator for the search group.

Returns:
the logical operator
  • AND_OPERATOR
  • OR_OPERATOR

  • setComparisonOperator

    public void setComparisonOperator(int operator)
    Sets the logical operator.
  • AND_OPERATOR
  • OR_OPERATOR

    Parameters:
    operator -

  • clear

    public void clear()
    Removes all search items from the list


    addSearchItem

    public SearchItem addSearchItem(SearchItem searchItem)
    Adds a search item to the search group.

    Currently at most one level of nesting is allowed. There are also many limitations imposed. Please see Javadoc for SearchGroup.

    Parameters:
    searchItem - the search item
    Returns:
    the search item

    addSearchItem

    public SearchItem addSearchItem(SearchDimension dimension,
                                    SearchConstraint constraint)
    Adds a search item.

    Parameters:
    dimension - the search dimension
    constraint - the search constraint

    removeSearchItem

    public SearchItem removeSearchItem(int index)
    Removes the search item from the list.

    Parameters:
    index - the index of the search item
    Returns:
    the search item removed

    getSearchItem

    public SearchItem getSearchItem(int index)
    Returns the search item.

    Parameters:
    index - the index
    Returns:
    the search item

    getSearchItems

    public SearchItem[] getSearchItems()
    Returns the list of search items.

    Returns:
    the list of search items


    Copyright 2004-2007 by SAP AG. All Rights Reserved.

    SAP, R/3, mySAP, mySAP.com, xApps, xApp, SAP NetWeaver, and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world. All other product and service names mentioned are the trademarks of their respective companies. Data contained in this document serves informational purposes only. National product specifications may vary.

    These materials are subject to change without notice. These materials are provided by SAP AG and its affiliated companies (SAP Group) for informational purposes only, without representation or warranty of any kind, and SAP Group shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty.