public class PredefinedOrder extends Object implements LexicographicalOrder
It provides a very simple lexicographical order based on the dimension ordering, with the possibility to choose the most significant dimension
| Constructor and Description |
|---|
PredefinedOrder(int[] ordering,
int mostSignificantDimension)
It specifies the comparison of k-dimensional point comparator based on
the dimension ordering and the most significant dimension.
|
| Modifier and Type | Method and Description |
|---|---|
String |
checkInvariants()
It checks the invariants for this order.
|
int |
compare(int[] p1,
int[] p2)
It compares two k-dimensional points.
|
int |
dimensionAt(int precedenceLevel)
It provides the dimension corresponding to the given precedence level
|
int |
getMostSignificantDimension()
This is equivalent to the call precedenceOf(0).
|
int[] |
masterOrdering()
It returns the ordering of dimensions used when no shift is applied
(i.e.
|
int |
precedenceOf(int dimension)
It provides the precedence level of the given dimension.
|
void |
setMostSignificantDimension(int d)
It shifts the lexicographical order so that the most significant dimension
is set to d.
|
String |
toString() |
public PredefinedOrder(int[] ordering,
int mostSignificantDimension)
ordering - how dimensions are stored within each compared point.mostSignificantDimension - the most significant dimensionpublic String checkInvariants()
public int compare(int[] p1,
int[] p2)
LexicographicalOrdercompare in interface LexicographicalOrderp1 - point 1p2 - point 2public int dimensionAt(int precedenceLevel)
LexicographicalOrderdimensionAt in interface LexicographicalOrderprecedenceLevel - the given precedence levelpublic int precedenceOf(int dimension)
LexicographicalOrderprecedenceOf in interface LexicographicalOrderdimension - the given dimensionpublic void setMostSignificantDimension(int d)
LexicographicalOrdersetMostSignificantDimension in interface LexicographicalOrderd - the dimension to be considered most significantpublic int getMostSignificantDimension()
LexicographicalOrdergetMostSignificantDimension in interface LexicographicalOrderpublic int[] masterOrdering()
LexicographicalOrdermasterOrdering in interface LexicographicalOrderCopyright © 2022. All rights reserved.