com.businessobjects.rebean.wi
Interface BlockSort


public interface BlockSort

Warning: This interface is no longer functional from the SAP BusinessObjects 4.0 release onwards.

The BloackSort is a collection of all sorts in an axis. Note that one BlockSort can be shared between several BlockAxis. See BlockAxis.getBlockSort() for more details.


Method Summary
 SortElement createSortElement(ReportExpression expr, SortType type)
          Create a sort on a report expression.
 boolean equals(java.lang.Object o)
          Compares the specified Object o with this BlockSort for equality.
 SortElement findSort(ReportExpression expr)
          Searches for a sort element matching a given expression.
 int getCount()
          Returns the number of sorts in this axis.
 SortElement getSortElement(int index)
          Returns the sort element at the specified position.
 boolean isHorizontal()
          Returns true if the sort list is horizontal to the corresponding block.
 void move(int fromIndex, int toIndex)
          Moves a sort element from one place to another in the hierarchy.
 void removeAll()
          Removes all sorts in this axis.
 void removeSort(int index)
          Remove a sort element at a given index.
 void removeSort(ReportExpression expr)
          Remove the sort element that matches the expression expr.
 

Method Detail

createSortElement

SortElement createSortElement(ReportExpression expr,
                              SortType type)
                              throws REException
Create a sort on a report expression. If their is a prior sort on that expression, the old sort element is replaced by the new one.

Parameters:
expr - The expression to create a sort on.
Returns:
The sort element describing the new sort.
Throws:
ReportException - when expr is not in the axis
java.lang.NullPointerException - when expr is null
REException

removeSort

void removeSort(ReportExpression expr)
Remove the sort element that matches the expression expr. No action occurs if there is no sort on expr in this BlockSort, or expr == null.

Parameters:
expr - the sort expression to be removed.

removeSort

void removeSort(int index)
Remove a sort element at a given index.

Parameters:
index - the index at which to remove the sort
Throws:
java.lang.ArrayIndexOutOfBoundsException - when index is out of range (index < 0 || index >= getCount())

removeAll

void removeAll()
Removes all sorts in this axis. Note: Attention should be taken using this function. The BlockSort object could represent sorts for several BlockAxis.


getCount

int getCount()
Returns the number of sorts in this axis.

Returns:
the number of sorts

getSortElement

SortElement getSortElement(int index)
Returns the sort element at the specified position.

Parameters:
index - the index of the sort element to return (0 based)
Returns:
the sort element at the specified index
Throws:
java.lang.ArrayIndexOutOfBoundsException - if index is out of range (index < 0 || index >= getCount())

findSort

SortElement findSort(ReportExpression expr)
Searches for a sort element matching a given expression.

Parameters:
expr - the expression to look for
Returns:
the sort element where SortElement.getExpression().equals(expr), or null when expr could not be found

isHorizontal

boolean isHorizontal()
Returns true if the sort list is horizontal to the corresponding block.
Note: For sections, this function will always return false.

Returns:
boolean true if this sort list is horizontal
See Also:
BlockAxis.getBlockSort(), ReportBlock.getBlockSort(boolean)

move

void move(int fromIndex,
          int toIndex)
Moves a sort element from one place to another in the hierarchy. This method is used to change the priority of a particular sort.

Parameters:
fromIndex - the index of the sort element to move.
toIndex - the index to which the sort is to be moved.
Throws:
java.lang.IndexOutOfBoundsException - when fromIndex or toIndex are invalid.
Since:
6.5.0

equals

boolean equals(java.lang.Object o)
Compares the specified Object o with this BlockSort for equality. Returns true if and only if the specified Object is also a BlockSort and has the same SortElements, in the same order.

Overrides:
equals in class java.lang.Object
Parameters:
o - the Object to be compared for equality with this BlockSort
Returns:
true if the specified Object is equal to this BlockSort