This class provides access to some Comparator instances that are commonly used in yFiles.
Type Details
- yfiles module
- algorithms
- yfiles-umd modules
- All layout modules, view-layout-bridge
- Legacy UMD name
- yfiles.algorithms.Comparers
Static Methods
Compares the specified floating point numbers.
Remarks
Returns a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.
Warning: This method has no special handling for NaN
. If you need NaN
-safe comparison, implement your own comparison instead.
Parameters
A map of options to pass to the method.
- d1 - number
- the first number to compare.
- d2 - number
- the second number to compare.
Returns
- ↪number
- a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.
See Also
Returns a IComparer<T> that compares to Objects of type Comparable.
Returns a IComparer<T> that compares objects of arbitrary type.
Remarks
Parameters
A map of options to pass to the method.
- dp - IDataProvider
- a data provider that must return a IComparable for each object that is being compared by this comparator.
Returns
- ↪IComparer<any>
- a IComparer<T> that compares arbitrary objects.
Returns a IComparer<T> that compares objects of arbitrary type.
Remarks
Parameters
A map of options to pass to the method.
- dp - IDataProvider
- a data provider that must return an int value for each object that is being compared by this comparator.
Returns
- ↪IComparer<any>
- a IComparer<T> that compares arbitrary objects.
Returns a IComparer<T> that compares objects of type Edge.
Remarks
e.source()
in turn is compared by the int value provided by the given data provider: dp.getInt(e.source())
.Parameters
A map of options to pass to the method.
- dp - IDataProvider
- a data provider that must return an int value for the source node of each edge being compared.
Returns
- ↪IComparer<any>
- a IComparer<T> that compares edges.
Returns a IComparer<T> that compares objects of type Edge.
Remarks
e.target()
in turn is compared by the int value provided by the given data provider: dp.getInt(e.target())
.Parameters
A map of options to pass to the method.
- dp - IDataProvider
- a data provider that must return an int value for the target node of each edge being compared.
Returns
- ↪IComparer<any>
- a IComparer<T> that compares edges.
Returns a IComparer<T> that compares objects of arbitrary type.
Remarks
Parameters
A map of options to pass to the method.
- dp - IDataProvider
- a data provider that must return a double value for each object that is being compared by this comparator.
Returns
- ↪IComparer<any>
- a IComparer<T> that compares arbitrary objects.
Returns a IComparer<T> that compares objects of type Edge.
Remarks
e.source()
in turn is compared by the double value provided by the given data provider: dp.getDouble(e.source())
.Parameters
A map of options to pass to the method.
- dp - IDataProvider
- a data provider that must return a double value for the source node of each edge being compared.
Returns
- ↪IComparer<any>
- a IComparer<T> that compares edges.
Returns a IComparer<T> that compares objects of type Edge.
Remarks
e.target()
in turn is compared by the double value provided by the given data provider: dp.getDouble(e.target())
.Parameters
A map of options to pass to the method.
- dp - IDataProvider
- a data provider that must return a double value for the target node of each edge being compared.
Returns
- ↪IComparer<any>
- a IComparer<T> that compares edges.