/** * Compares two axis for order. This method is invoked automatically by the {@link * #replace(CoordinateSystem) replace} method for ordering the axis in a coordinate system. The * default implementation orders the axis according their {@linkplain * CoordinateSystemAxis#getDirection direction}, using the direction table given at {@linkplain * #OrderedAxisAuthorityFactory(AbstractAuthorityFactory, Hints, AxisDirection[]) construction * time} (see also the class description). Subclasses may override this method if they want to * define a more sophesticated axis ordering. * * @param axis1 The first axis to compare. * @param axis2 The second axis to compare. * @return A negative integer if {@code axis1} should appears before {@code axis2}, or a * positive number if {@code axis2} should appears before {@code axis1}, or 0 if the two * axis are unordered one relative to the other. * @todo The argument type will be changed to {@link CoordinateSystemAxis} when we will be * allowed to compile for J2SE 1.5. * @since 2.3 */ public int compare(final Object axis1, final Object axis2) { return rank((CoordinateSystemAxis) axis1) - rank((CoordinateSystemAxis) axis2); }