jet.api
Class GroupInfo

java.lang.Object
  extended by jet.api.GroupInfo

public class GroupInfo
extends java.lang.Object

GroupInfo defines the information of a JReport Group object. The GroupInfo includes the information of groupby, sort, and special group options.


Field Summary
static int ASCENDING
          The sort type of the group.
static int DESCENDING
          The sort type of the group.
static int NOTSORTED
          The sort type of the group.
static int SELECTE_TYPE_All
          The select N type.
static int SELECTE_TYPE_BOTTOM_N
          The select N type.
static int SELECTE_TYPE_NONE
          Deprecated. The select N type.
static int SELECTE_TYPE_TOP_N
          The select N type.
 
Constructor Summary
GroupInfo(java.lang.String groupBy, int groupOrder)
          Constructor.
GroupInfo(java.lang.String groupBy, int groupOrder, boolean needSelectN, int selectN, boolean keepOthers, java.lang.String otherName, SortInfo[] sortInfo)
          Constructor.
GroupInfo(java.lang.String groupBy, int groupOrder, boolean needSelectN, int selectN, boolean keepOthers, java.lang.String otherName, SortInfo[] sortInfo, java.lang.String report)
          Constructor.
GroupInfo(java.lang.String groupBy, int groupOrder, java.lang.String report)
          Constructor.
 
Method Summary
 void addSortInfo(SortInfo info)
          Adds SortInfo information of the group.
 void downSortInfo(int index)
          Moves down the sort information with the specified index in the SortInfo list.
 java.lang.String getBLName()
          Gets BusinessLogic field name for the groupBy.
 java.lang.String getGroupBy()
          Gets the groupBy column's mapping name.
 int getGroupOrder()
          Gets the group's sort type.
 boolean getKeepOthers()
          Gets the status of whether or not to keep the records outside the SelectN in the "Others Group".
 boolean getNeedTopN()
          Gets the status of whether or not to set SelectN option.
 java.lang.String getOtherName()
          Gets the group name of the "Others Group".
 java.lang.String getReport()
          Gets the report's handle of the group.
 int getSelectN()
          Gets the SelectN option's number.
 int getSelectType()
          Gets the type of SelectN option.
 SortInfo[] getSortInfo()
          Gets SortInfo information of the group.
 SpecGroupInfo getSpecGroupInfo()
          Gets the User Defined group's conditions.
 int getTopN()
          Gets the SelectN option's number.
 int indexOfSortInfo(SortInfo info)
          Gets the index number of the specified sort information.
 int indexOfSortInfo(java.lang.String sortBy)
          Gets the index number of the sort information with the specified SortBy's mapping name.
 boolean insertSortInfo(SortInfo sinfo, int index)
          Adds SortInfo information at the specified index.
 boolean isSortIn(java.lang.String sortBy)
          Checks whether or not there is a SortInfo information which is sorted by the specified SortBy mapping name.
 void removeSortInfo(int index)
          Removes sort information at the specified index.
 void removeSortInfo(SortInfo info)
          Removes the SortInfo information from the group.
 void removeSortInfo(java.lang.String sortBy)
          Removes SortInfo information with specified SortBy's mapping name.
 void setBLName(java.lang.String blName)
          Sets the BusinessLogic field name for the groupBy.
 void setGroupOrder(int groupOrder)
          Sets the group's sort type.
 void setKeepOthers(boolean keepOthers)
          Sets the status of whether or not to keep the records outside the SelectN in the "Others Group".
 void setNeedTopN(boolean needSelectN)
          Sets the status of whether or not to apply SelectN option.
 void setOtherName(java.lang.String otherName)
          Sets the group name of the "Others Group".
 void setReport(java.lang.String report)
          Sets the report's handle of the group.
 void setSelectN(int selectN)
          Sets SelectN option's number.
 void setSelectType(int selectType)
          Sets the type of SelectN option.
 void setSortInfo(SortInfo[] sInfo)
          Sets SortInfo information of the group.
 void setSpecGroupInfo(SpecGroupInfo info)
          Sets the User Defined group's conditions.
 void setTopN(int selectN)
          Sets SelectN option's number.
 java.lang.String toString()
           
 void upSortInfo(int index)
          Moves up the sort information with the specified index in the SortInfo list.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ASCENDING

public static final int ASCENDING
The sort type of the group.

See Also:
Constant Field Values

DESCENDING

public static final int DESCENDING
The sort type of the group.

See Also:
Constant Field Values

NOTSORTED

public static final int NOTSORTED
The sort type of the group.

See Also:
Constant Field Values

SELECTE_TYPE_All

public static final int SELECTE_TYPE_All
The select N type.

See Also:
Constant Field Values

SELECTE_TYPE_NONE

public static final int SELECTE_TYPE_NONE
Deprecated. The select N type.
See Also:
Constant Field Values

SELECTE_TYPE_TOP_N

public static final int SELECTE_TYPE_TOP_N
The select N type.

See Also:
Constant Field Values

SELECTE_TYPE_BOTTOM_N

public static final int SELECTE_TYPE_BOTTOM_N
The select N type.

See Also:
Constant Field Values
Constructor Detail

GroupInfo

public GroupInfo(java.lang.String groupBy,
                 int groupOrder)
Constructor. Creates a Group object's information.

Parameters:
groupBy - The mapping name of the groupBy field.
groupOrder - The sort type of the group.
See Also:
#ASCENDING}, {@link #DESCENDING}, {@link #NOTSORTED}

GroupInfo

public GroupInfo(java.lang.String groupBy,
                 int groupOrder,
                 java.lang.String report)
Constructor. Creates a Group object's information.

Parameters:
groupBy - The mapping name of the groupBy field.
groupOrder - The sort type of the group.
report - The handle of the report.
See Also:
#ASCENDING}, {@link #DESCENDING}, {@link #NOTSORTED}

GroupInfo

public GroupInfo(java.lang.String groupBy,
                 int groupOrder,
                 boolean needSelectN,
                 int selectN,
                 boolean keepOthers,
                 java.lang.String otherName,
                 SortInfo[] sortInfo)
Constructor. Creates a Group object's information.

Parameters:
groupBy - The mapping name of the groupBy field.
groupOrder - Indicates the sort type of the group.
needSelectN - Indicates whether or not to apply SelectN option.
SelectN - Indicates the SelectN option's number.
keepOthers - Indicates whether or not to keep the records outside the SelectN in "Others Group".
otherName - Indicates the group name of the "Others Group".
sortInfo - The SortInfo information of the group.
See Also:
#ASCENDING}, {@link #DESCENDING}, {@link #NOTSORTED}

GroupInfo

public GroupInfo(java.lang.String groupBy,
                 int groupOrder,
                 boolean needSelectN,
                 int selectN,
                 boolean keepOthers,
                 java.lang.String otherName,
                 SortInfo[] sortInfo,
                 java.lang.String report)
Constructor. Creates a Group object's information.

Parameters:
groupBy - The mapping name of the groupBy field.
groupOrder - Indicates the sort type of the group.
needSelectN - Indicates whether or not to apply SelectN option.
SelectN - Indicates the SelectN option's number.
keepOthers - Indicates whether or not to keep the records outside the SelectN in the "Others Group".
otherName - Indicates the group name of the "Others Group".
sortInfo - The SortInfo information of the group.
report - Handle of the report.
See Also:
#ASCENDING}, {@link #DESCENDING}, {@link #NOTSORTED}
Method Detail

getReport

public java.lang.String getReport()
Gets the report's handle of the group.

Returns:
report's handle string.

setReport

public void setReport(java.lang.String report)
Sets the report's handle of the group.

Parameters:
report - Report handle.

getGroupBy

public java.lang.String getGroupBy()
Gets the groupBy column's mapping name.

Returns:
the string of the groupBy column's mapping name.

getBLName

public java.lang.String getBLName()
Gets BusinessLogic field name for the groupBy.

Returns:
the string of BusinessLogic field name for the groupBy.

setBLName

public void setBLName(java.lang.String blName)
Sets the BusinessLogic field name for the groupBy.

Parameters:
blName - The BusinessLogic field name for the groupBy.

getGroupOrder

public int getGroupOrder()
Gets the group's sort type.

Returns:
int value of the group's sort type.
See Also:
setGroupOrder(int)

setGroupOrder

public void setGroupOrder(int groupOrder)
Sets the group's sort type.

Parameters:
groupOrder - The group's sort type.
See Also:
#ASCENDING}, {@link #DESCENDING}, {@link #NOTSORTED}

getNeedTopN

public boolean getNeedTopN()
Gets the status of whether or not to set SelectN option.

Returns:
true if the group's SelectN option is set; false otherwise.
See Also:
setNeedTopN(boolean)

getTopN

public int getTopN()
Gets the SelectN option's number. This will take effect if and only if the NeedSelectN is true.

Returns:
SelectN number.
See Also:
#setNeedTopN(boolean)}, {@link #setSelectN(int)}

getKeepOthers

public boolean getKeepOthers()
Gets the status of whether or not to keep the records outside the SelectN in the "Others Group". This will take effect if and only if the NeedSelectN is true.

Returns:
true if the records outside the SelectN are to be kept in the "Others Group"; false otherwise.
See Also:
#setKeepOthers(boolean)}, {@link #setSelectN(int)}

getOtherName

public java.lang.String getOtherName()
Gets the group name of the "Others Group".

Returns:
name string of the "Others Group" .

setTopN

public void setTopN(int selectN)
Sets SelectN option's number. This will take effect if and only if the NeedSelectN is true.

Parameters:
selectN - The number of SelectN option.
See Also:
setNeedTopN(boolean)

setNeedTopN

public void setNeedTopN(boolean needSelectN)
Sets the status of whether or not to apply SelectN option.

Parameters:
needSelectN - Specifies the status of needTopN.

setKeepOthers

public void setKeepOthers(boolean keepOthers)
Sets the status of whether or not to keep the records outside the SelectN in the "Others Group". This will take effect if and only if the NeedSelectN is true.

Parameters:
keepOthers - Sets true if the records outside the SelectN are to be kept in the "Others Group"; false otherwise.
See Also:
setNeedTopN(boolean)

setOtherName

public void setOtherName(java.lang.String otherName)
Sets the group name of the "Others Group". This will take effect if and only if the NeedSelectN and KeepOthers both are true.

Parameters:
otherName - Name string of the "Others Group".
See Also:
#setNeedTopN(boolean)}, {@link #setKeepOthers(boolean)}

getSortInfo

public SortInfo[] getSortInfo()
Gets SortInfo information of the group.

Returns:
array of SortInfo list.

setSortInfo

public void setSortInfo(SortInfo[] sInfo)
Sets SortInfo information of the group.

Parameters:
sInfo - The SortInfo information.

addSortInfo

public void addSortInfo(SortInfo info)
Adds SortInfo information of the group.

Parameters:
info - The SortInfo information

insertSortInfo

public boolean insertSortInfo(SortInfo sinfo,
                              int index)
Adds SortInfo information at the specified index.

Parameters:
sinfo - SortInfo information.
index - The index number of the sort information list.
Returns:
true if the SortInfo information is inserted successfully; false otherwise.

removeSortInfo

public void removeSortInfo(SortInfo info)
Removes the SortInfo information from the group.

Parameters:
info - SortInfo information to be removed.

removeSortInfo

public void removeSortInfo(java.lang.String sortBy)
Removes SortInfo information with specified SortBy's mapping name.

Parameters:
sortBy - The SortBy's mapping name of the SortInfo information.
See Also:
#SortInfo}

removeSortInfo

public void removeSortInfo(int index)
Removes sort information at the specified index.

Parameters:
index - Index number of the SortInfo information.

indexOfSortInfo

public int indexOfSortInfo(java.lang.String sortBy)
Gets the index number of the sort information with the specified SortBy's mapping name.

Parameters:
sortBy - The SortBy's mapping name of SortInfo.
Returns:
the index number of the SortInfo list.
See Also:
#SortInfo}

indexOfSortInfo

public int indexOfSortInfo(SortInfo info)
Gets the index number of the specified sort information.

Parameters:
info - The SortInfo object to be detected.
Returns:
index number of the SortInfo list.

upSortInfo

public void upSortInfo(int index)
Moves up the sort information with the specified index in the SortInfo list.

Parameters:
index - The index number of the SortInfo in the SortInfo list.

downSortInfo

public void downSortInfo(int index)
Moves down the sort information with the specified index in the SortInfo list.

Parameters:
index - The index number of the SortInfo in the SortInfo list.

isSortIn

public boolean isSortIn(java.lang.String sortBy)
Checks whether or not there is a SortInfo information which is sorted by the specified SortBy mapping name.

Parameters:
sortBy - The specified SortBy mapping name.
Returns:
true if there exists SortInfo information which is sorted by the specified SortBy mapping name; false otherwise.

setSpecGroupInfo

public void setSpecGroupInfo(SpecGroupInfo info)
Sets the User Defined group's conditions.

Parameters:
info - The User Defined group's conditions.

getSpecGroupInfo

public SpecGroupInfo getSpecGroupInfo()
Gets the User Defined group's conditions.

Returns:
the SpecGroupInfo presenting the User Defined group's conditions.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

setSelectType

public void setSelectType(int selectType)
Sets the type of SelectN option.

Parameters:
selectType - Int value of SelectN option's type.
See Also:
#SELECTE_TYPE_All},{@link #SELECTE_TYPE_TOP_N}, {@link #SELECTE_TYPE_BOTTOM_N}

getSelectType

public int getSelectType()
Gets the type of SelectN option.

Returns:
int value of SelectN option's type.
See Also:
setSelectType(int)

getSelectN

public int getSelectN()
Gets the SelectN option's number. This will take effect if and only if the NeedSelectN is true.

Returns:
SelectN number.
See Also:
setNeedTopN(boolean)

setSelectN

public void setSelectN(int selectN)
Sets SelectN option's number. This will take effects if and only if the NeedSelectN is true.

Parameters:
Number - of SelectN option.
See Also:
setNeedTopN(boolean)