public class ComparisonUtil<T extends Comparable<T>> extends Object
The comparison utility class.
T
:
The type of a comparable elements.
Constructor and Description |
---|
ComparisonUtil()
Initializes a new instance of the
ComparisonUtil{T} class. |
ComparisonUtil(Comparator<T> defaultComparer)
Initializes a new instance of the
ComparisonUtil{T} class. |
Modifier and Type | Method and Description |
---|---|
Comparator<T> |
getAscendingComparer()
Gets the ascending comparer.
|
static <T extends Comparable<T>> |
getDefault(Class<T> cls)
Gets the default instance.
|
static <T extends Comparable<T>> |
getDefaultAscendingComparer(Class<T> cls)
Gets the default ascending comparer.
|
static <T extends Comparable<T>> |
getDefaultDescendingComparer(Class<T> cls)
Gets the default descending comparer.
|
Comparator<T> |
getDescendingComparer()
Gets the descending comparer.
|
public ComparisonUtil()
Initializes a new instance of the ComparisonUtil{T}
class.
public ComparisonUtil(Comparator<T> defaultComparer)
Initializes a new instance of the ComparisonUtil{T}
class.
defaultComparer
- The default comparer.public static <T extends Comparable<T>> ComparisonUtil<T> getDefault(Class<T> cls)
Gets the default instance.
public static <T extends Comparable<T>> Comparator<T> getDefaultAscendingComparer(Class<T> cls)
Gets the default ascending comparer.
public static <T extends Comparable<T>> Comparator<T> getDefaultDescendingComparer(Class<T> cls)
Gets the default descending comparer.
public Comparator<T> getAscendingComparer()
Gets the ascending comparer.
public Comparator<T> getDescendingComparer()
Gets the descending comparer.
Copyright (c) 2017 Aspose. All Rights Reserved.