Style Intelligence v12.0

inetsoft.report.filter
Class DefaultComparer

java.lang.Object
  extended by inetsoft.util.DefaultComparator
      extended by inetsoft.report.filter.DefaultComparer
All Implemented Interfaces:
Comparer, Serializable, Cloneable, Comparator
Direct Known Subclasses:
DimensionComparer

public class DefaultComparer
extends inetsoft.util.DefaultComparator
implements Comparer

Object comparison interface. This comparer compares two objects as numbers if they are both Number (Integer, Long, Double, ...). Otherwise it performs a string comparison.

See Also:
Serialized Form

Field Summary
 
Fields inherited from interface inetsoft.report.Comparer
NEGATIVE_DOUBLE_ERROR, NEGATIVE_FLOAT_ERROR, POSITIVE_DOUBLE_ERROR, POSITIVE_FLOAT_ERROR
 
Constructor Summary
DefaultComparer()
          Constructor.
 
Method Summary
 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(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.
 
Methods inherited from class inetsoft.util.DefaultComparator
clone, compare, getSign, isCaseSensitive, isNegate, setCaseSensitive, setNegate
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface inetsoft.report.Comparer
compare
 
Methods inherited from interface java.util.Comparator
equals
 

Constructor Detail

DefaultComparer

public DefaultComparer()
Constructor.

Method Detail

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.

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