compareLocationValuesStatic static method
Compares two sets of location values for order.
@param componentIndex0 a component index @param segmentIndex0 a segment index @param segmentFraction0 a segment fraction @param componentIndex1 another component index @param segmentIndex1 another segment index @param segmentFraction1 another segment fraction @return a negative integer, zero, or a positive integer as the first set of location values is less than, equal to, or greater than the second set of locationValues
Implementation
static int compareLocationValuesStatic(
int componentIndex0,
int segmentIndex0,
double segmentFraction0,
int componentIndex1,
int segmentIndex1,
double segmentFraction1) {
// compare component indices
if (componentIndex0 < componentIndex1) return -1;
if (componentIndex0 > componentIndex1) return 1;
// compare segments
if (segmentIndex0 < segmentIndex1) return -1;
if (segmentIndex0 > segmentIndex1) return 1;
// same segment, so compare segment fraction
if (segmentFraction0 < segmentFraction1) return -1;
if (segmentFraction0 > segmentFraction1) return 1;
// same location
return 0;
}