Enum AxesMapper
- All Implemented Interfaces:
Serializable
,Comparable<AxesMapper>
,java.lang.constant.Constable
Maps coordinate axes for a "sub-coordinate system" to the axes of a coordinate systems with more dimensions.
This enumeration contains the criterion to apply for matching axes, in priority order.
In current implementation, the enumeration values are used only internally.
The useful method is indices(CoordinateSystem, CoordinateSystem)
.
- Since:
- 1.2
- Version:
- 1.2
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum Constants -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static long
clearMask
(int dim) Returns a mask for clearing the bit associated to the given coordinate system dimension.private static boolean
hasMore
(int numBits) Returnstrue
if the given value computed byLong.numberOfTrailingZeros(long)
means that there is at least one more dimension to process.static int[]
indices
(org.opengis.referencing.cs.CoordinateSystem cs, org.opengis.referencing.cs.CoordinateSystem subCS) Returns the indices incs
of axes presumed covariant with thesubCS
axes.static AxesMapper
Returns the enum constant of this type with the specified name.static AxesMapper[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
SAME
Match axes having the exact same direction. -
OPPOSITE
Match axes having opposite direction. -
POLAR
Match axes of the kind "South along 90° East".
-
-
Field Details
-
EAST
private static final int EASTBitmask for axis direction handled in a special way. They are the substitute for directions like "South along 90° East". We arbitrarily replace the first direction by East and the second direction by North.- See Also:
-
NORTH
private static final int NORTHBitmask for axis direction handled in a special way. They are the substitute for directions like "South along 90° East". We arbitrarily replace the first direction by East and the second direction by North.- See Also:
-
-
Constructor Details
-
AxesMapper
private AxesMapper()
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
indices
public static int[] indices(org.opengis.referencing.cs.CoordinateSystem cs, org.opengis.referencing.cs.CoordinateSystem subCS) Returns the indices incs
of axes presumed covariant with thesubCS
axes. Directions such as "South along 90°E" are arbitrarily handled as if they were covariant with East and North.Limitations
Current implementation considers only the first 64 dimensions. If there is more dimensions, the extra ones are silently ignored.- Parameters:
cs
- the coordinate system which contains all axes, ornull
.subCS
- the coordinate system to search intocs
.- Returns:
- indices in
cs
of axes covariant withsubCS
axes in the order they appear insubCS
, ornull
if at least onesubCS
axis cannot be mapped to acs
axis.
-
hasMore
private static boolean hasMore(int numBits) Returnstrue
if the given value computed byLong.numberOfTrailingZeros(long)
means that there is at least one more dimension to process. This is used for stopping iterations. -
clearMask
private static long clearMask(int dim) Returns a mask for clearing the bit associated to the given coordinate system dimension.
-