Style Intelligence v12.0

inetsoft.report.filter
Class SortOrder

java.lang.Object
  extended by inetsoft.report.filter.SortOrder
All Implemented Interfaces:
Comparer, XConstants, Serializable, Cloneable, Comparator
Direct Known Subclasses:
DimensionSortOrder

public class SortOrder
extends Object
implements Comparer, Cloneable, Comparator, XConstants

Group sort order class. This class defines several sort constant and used to define specific group sort order.

See Also:
Serialized Form

Field Summary
static int GROUP_OTHERS
          Other group option when using specific order: put all others together.
static int LEAVE_OTHERS
          Other group option when using specific order: leave all other data in their own group.
static int SORT_ASC
          Ascendent order.
static int SORT_DESC
          Descendent order.
static int SORT_NONE
          No sorting.
static int SORT_ORIGINAL
          Original order, treat the data as already sorted.
static int SORT_SPECIFIC
          Specific order, using named group.
static int SORT_VALUE_ASC
          Sort by value ascendent order.
static int SORT_VALUE_DESC
          Sort by value descendent order.
 
Fields inherited from interface inetsoft.report.Comparer
NEGATIVE_DOUBLE_ERROR, NEGATIVE_FLOAT_ERROR, POSITIVE_DOUBLE_ERROR, POSITIVE_FLOAT_ERROR
 
Fields inherited from interface inetsoft.uql.XConstants
AM_PM_DATE_GROUP, AM_PM_OF_DAY_DATE_GROUP, AVERAGE_FORMULA, CALC_FORMULA, COLUMN, CONCAT_FORMULA, CONDITION_EMPTY_STRING, CONDITION_NULL_STRING, CONDITION_NULL_VALUE, CONDITION_REAL_NULL, CORRELATION_FORMULA, COUNT_FORMULA, COVARIANCE_FORMULA, CURRENCY_FORMAT, CURRENT_REP_CHANGED, CURRENT_REP_WILL_CHANGE, DATE_FORMAT, DAY_DATE_GROUP, DAY_OF_MONTH_DATE_GROUP, DAY_OF_WEEK_DATE_GROUP, DAY_OF_YEAR_DATE_GROUP, DECIMAL_FORMAT, DISTINCTCOUNT_FORMULA, FIRST_FORMULA, FULL_JOIN, GREATER_EQUAL_JOIN, GREATER_JOIN, HOUR_DATE_GROUP, HOUR_OF_DAY_DATE_GROUP, INNER_JOIN, JOIN, LAST_FORMULA, LEFT_JOIN, LESS_EQUAL_JOIN, LESS_JOIN, MAX_FORMULA, MEDIAN_FORMULA, MESSAGE_FORMAT, MILLISECOND_DATE_GROUP, MIN_FORMULA, MINUTE_DATE_GROUP, MODE_FORMULA, MONTH_DATE_GROUP, MONTH_OF_YEAR_DATE_GROUP, NONE_DATE_GROUP, NONE_FORMULA, NOT_EQUAL_JOIN, NTHLARGEST_FORMULA, NTHMOSTFREQUENT_FORMULA, NTHSMALLEST_FORMULA, PARAM_PREFIX, PART_DATE_GROUP, PERCENT_FORMAT, PERCENTAGE_BY_COL, PERCENTAGE_BY_ROW, PERCENTAGE_NONE, PERCENTAGE_OF_COL_GRANDTOTAL, PERCENTAGE_OF_COL_GROUP, PERCENTAGE_OF_GRANDTOTAL, PERCENTAGE_OF_GROUP, PERCENTAGE_OF_ROW_GRANDTOTAL, PERCENTAGE_OF_ROW_GROUP, POPULATIONSTANDARDDEVIATION_FORMULA, POPULATIONVARIANCE_FORMULA, PRODUCT_FORMULA, PTHPERCENTILE_FORMULA, QUARTER_DATE_GROUP, QUARTER_OF_YEAR_DATE_GROUP, RIGHT_JOIN, SECOND_DATE_GROUP, SET_FORMULA, STANDARDDEVIATION_FORMULA, SUB_QUERY_PARAM, SUM_FORMULA, SUMSQ_FORMULA, SUMWT_FORMULA, VARIANCE_FORMULA, WEEK_DATE_GROUP, WEEK_OF_MONTH_DATE_GROUP, WEEK_OF_YEAR_DATE_GROUP, WEIGHTEDAVERAGE_FORMULA, YEAR_DATE_GROUP
 
Constructor Summary
SortOrder(int type)
          Create a sort order object with order type.
 
Method Summary
 void addGroupCondition(String name, ConditionGroup group)
          Get the ith specific group name.
 Object clone()
          Clone this object.
 int compare(Date d1, Date d2)
          Return compare of two date according to the date order selection.
 int compare(double v1, double v2)
          This method should return > 0 if v1 is greater than v2, 0 if v1 is equal to v2, or < 0 if v1 is less than v2.
 int compare(float v1, float v2)
          This method should return > 0 if v1 is greater than v2, 0 if v1 is equal to v2, or < 0 if v1 is less than v2.
 int compare(int v1, int v2)
          This method should return > 0 if v1 is greater than v2, 0 if v1 is equal to v2, or < 0 if v1 is less than v2.
 int compare(long v1, long v2)
          This method should return > 0 if v1 is greater than v2, 0 if v1 is equal to v2, or < 0 if v1 is less than v2.
 int compare(Object d1, Object d2)
          Comparer interface.
 int compare(short v1, short v2)
          This method should return > 0 if v1 is greater than v2, 0 if v1 is equal to v2, or < 0 if v1 is less than v2.
 boolean containsGroup(Object name)
          Check if contains a named group.
 String getDataType()
          Get data type.
 String getGroupName(int index)
          Get specific group names.
 int getGroupNameIndex(Object name)
          Get the index of a group name.
 String[] getGroupNames()
          Get specific group names.
 double getInterval()
          Get date period interval.
 int getOption()
          Get date period option.
 int getOrder()
          Get order type.
 int getOthers()
          Get other groups option.
 boolean isAsc()
          Determine if the order type if ascendent.
 boolean isDatePostProcess()
          Check date is post proocessed here.
 boolean isDesc()
          Determine if the order type if descendent.
 boolean isOriginal()
          Determine if the order type if original sort.
 boolean isSpecific()
          Determine if using specific order.
 void removeAllGroupNames()
          Remove all specific group names.
 void removeGroupCondition(String name)
          Get the ith specific group name.
 void setAsc(boolean asc)
          Set ascending option.
 void setDataType(String dtype)
          Set data type.
 void setDatePostProcess(boolean post)
          Set date type object need post process here, for worksheet and viewsheet, cause we already create a formula field to post process it, so the tag will be always false, and for designer and adhoc, if db has been process it already, this tag will be false, otherwise will be true, default is true.
 void setDesc(boolean desc)
          Set descending option.
 void setGroupCondition(String name, ConditionGroup group)
          Get the ith specific group name.
 void setInterval(double d, int opt)
          Set date period interval and option.
 void setOrder(int type)
          Set the type of order.
 void setOriginal(boolean original)
          Set original option.
 void setOthers(int others)
          Set other groups option.
 void setSpecific(boolean b)
          Set specific order option.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Field Detail

SORT_ASC

public static final int SORT_ASC
Ascendent order.

See Also:
Constant Field Values

SORT_DESC

public static final int SORT_DESC
Descendent order.

See Also:
Constant Field Values

SORT_VALUE_ASC

public static final int SORT_VALUE_ASC
Sort by value ascendent order.

See Also:
Constant Field Values

SORT_VALUE_DESC

public static final int SORT_VALUE_DESC
Sort by value descendent order.

See Also:
Constant Field Values

SORT_ORIGINAL

public static final int SORT_ORIGINAL
Original order, treat the data as already sorted.

See Also:
Constant Field Values

SORT_SPECIFIC

public static final int SORT_SPECIFIC
Specific order, using named group.

See Also:
Constant Field Values

SORT_NONE

public static final int SORT_NONE
No sorting.

See Also:
Constant Field Values

GROUP_OTHERS

public static final int GROUP_OTHERS
Other group option when using specific order: put all others together.

See Also:
Constant Field Values

LEAVE_OTHERS

public static final int LEAVE_OTHERS
Other group option when using specific order: leave all other data in their own group.

See Also:
Constant Field Values
Constructor Detail

SortOrder

public SortOrder(int type)
Create a sort order object with order type.

Parameters:
type - type of order, one of SORT_ASC, SORT_DESC, SORT_ORIGINAL and SORT_SPECIFIC.
Method Detail

setDatePostProcess

public void setDatePostProcess(boolean post)
Set date type object need post process here, for worksheet and viewsheet, cause we already create a formula field to post process it, so the tag will be always false, and for designer and adhoc, if db has been process it already, this tag will be false, otherwise will be true, default is true.


isDatePostProcess

public boolean isDatePostProcess()
Check date is post proocessed here.


getOrder

public int getOrder()
Get order type.

Returns:
type of order.

setOrder

public void setOrder(int type)
Set the type of order.

Parameters:
type - type of order.

getDataType

public String getDataType()
Get data type.

Returns:
data type.

setDataType

public void setDataType(String dtype)
Set data type.

Parameters:
dtype - the specified data type.

isAsc

public boolean isAsc()
Determine if the order type if ascendent.

Returns:
true for ascendent.

setAsc

public void setAsc(boolean asc)
Set ascending option.

Parameters:
asc - true if ascending, false if descending

isDesc

public boolean isDesc()
Determine if the order type if descendent.

Returns:
true for descendent.

setDesc

public void setDesc(boolean desc)
Set descending option.

Parameters:
desc - true if descending, false if ascending

isOriginal

public boolean isOriginal()
Determine if the order type if original sort.

Returns:
true for original sort.

setOriginal

public void setOriginal(boolean original)
Set original option.

Parameters:
original - true if original is on, false if original is off

isSpecific

public boolean isSpecific()
Determine if using specific order.

Returns:
true for using specific order.

setSpecific

public void setSpecific(boolean b)
Set specific order option.

Parameters:
b - true for using specific order.

getGroupNames

public String[] getGroupNames()
Get specific group names.

Returns:
group names.

getGroupName

public String getGroupName(int index)
Get specific group names.

Returns:
group names.

getGroupNameIndex

public int getGroupNameIndex(Object name)
Get the index of a group name.

if the specified group name is not found, take it to be "Others" and return Integer.MAX_VALUE.

Parameters:
name - the specified group name
Returns:
the index of the specified group name

containsGroup

public boolean containsGroup(Object name)
Check if contains a named group.

Parameters:
name - the specified group name
Returns:
true if contains the group, false otherwise

addGroupCondition

public void addGroupCondition(String name,
                              ConditionGroup group)
Get the ith specific group name.


setGroupCondition

public void setGroupCondition(String name,
                              ConditionGroup group)
Get the ith specific group name.


removeGroupCondition

public void removeGroupCondition(String name)
Get the ith specific group name.


removeAllGroupNames

public void removeAllGroupNames()
Remove all specific group names.


setOthers

public void setOthers(int others)
Set other groups option.

Parameters:
others - other group option.

getOthers

public int getOthers()
Get other groups option.

Returns:
other group option.

setInterval

public void setInterval(double d,
                        int opt)
Set date period interval and option.

Parameters:
d - date period interval.
opt - date period option.

getInterval

public double getInterval()
Get date period interval.

Returns:
date period interval.

getOption

public int getOption()
Get date period option.

Returns:
date period option.

compare

public int compare(double v1,
                   double v2)
This method should return > 0 if v1 is greater than v2, 0 if v1 is equal to v2, or < 0 if v1 is less than v2. It must handle null values for the comparison values.

Specified by:
compare in interface Comparer
Parameters:
v1 - comparison value.
v2 - comparison value.
Returns:
< 0, 0, or > 0 for v1v2.

compare

public int compare(float v1,
                   float v2)
This method should return > 0 if v1 is greater than v2, 0 if v1 is equal to v2, or < 0 if v1 is less than v2. It must handle null values for the comparison values.

Specified by:
compare in interface Comparer
Parameters:
v1 - comparison value.
v2 - comparison value.
Returns:
< 0, 0, or > 0 for v1v2.

compare

public int compare(long v1,
                   long v2)
This method should return > 0 if v1 is greater than v2, 0 if v1 is equal to v2, or < 0 if v1 is less than v2. It must handle null values for the comparison values.

Specified by:
compare in interface Comparer
Parameters:
v1 - comparison value.
v2 - comparison value.
Returns:
< 0, 0, or > 0 for v1v2.

compare

public int compare(int v1,
                   int v2)
This method should return > 0 if v1 is greater than v2, 0 if v1 is equal to v2, or < 0 if v1 is less than v2. It must handle null values for the comparison values.

Specified by:
compare in interface Comparer
Parameters:
v1 - comparison value.
v2 - comparison value.
Returns:
< 0, 0, or > 0 for v1v2.

compare

public int compare(short v1,
                   short v2)
This method should return > 0 if v1 is greater than v2, 0 if v1 is equal to v2, or < 0 if v1 is less than v2. It must handle null values for the comparison values.

Specified by:
compare in interface Comparer
Parameters:
v1 - comparison value.
v2 - comparison value.
Returns:
< 0, 0, or > 0 for v1v2.

compare

public int compare(Object d1,
                   Object d2)
Comparer interface.

Specified by:
compare in interface Comparer
Specified by:
compare in interface Comparator
Parameters:
d1 - comparison value.
d2 - comparison value.
Returns:
< 0, 0, or > 0 for v1v2.

compare

public int compare(Date d1,
                   Date d2)
Return compare of two date according to the date order selection.


clone

public Object clone()
Clone this object.

Overrides:
clone in class Object

Copyright © 1996-2014 InetSoft Technology Corp. All Rights Reserved.