|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectEnumeratedParameter
org.deegree_impl.model.cs.AxisOrientation
Orientation of axis. Some coordinate systems use non-standard orientations.
For example, the first axis in South African grids usually points West,
instead of East. This information is obviously relevant for algorithms
converting South African grid coordinates into Lat/Long.
The natural ordering for axis orientations is defined
as (EAST-WEST), (NORTH-SOUTH), (UP-DOWN), (FUTURE-PAST) and OTHER, which is
the ordering for a (x,y,z,t) coordinate
system. This means that when an array of AxisOrientation
s is sorted using
Arrays.sort(Object[])
, EAST and WEST orientations will
appears first. NORTH and SOUTH will be next, followed by UP and DOWN, etc.
Care should be exercised if AxisOrientation
s are to be used as keys in
a sorted map or elements in a sorted set, as AxisOrientation
's natural
ordering is inconsistent with equals. See Comparable
,
SortedMap
or SortedSet
for more information.
CS_AxisOrientationEnum
,
Serialized FormField Summary | |
static AxisOrientation |
DOWN
Increasing ordinates values go down. |
static AxisOrientation |
EAST
Increasing ordinates values go East. |
private static AxisOrientation[] |
ENUMS
Axis orientations by value. |
static AxisOrientation |
FUTURE
Increasing time go toward future. |
private int |
key
Resource key, used for building localized name. |
private static int |
LAST_PAIRED_VALUE
The last paired value. |
static AxisOrientation |
NORTH
Increasing ordinates values go North. |
private static AxisOrientation[] |
ORDER
The axis order. |
static AxisOrientation |
OTHER
Unknown or unspecified axis orientation. |
static AxisOrientation |
PAST
Increasing time go toward past. |
private static long |
serialVersionUID
Serial number for interoperability with different versions. |
static AxisOrientation |
SOUTH
Increasing ordinates values go South. |
static AxisOrientation |
UP
Increasing ordinates values go up. |
static AxisOrientation |
WEST
Increasing ordinates values go West. |
Constructor Summary | |
private |
AxisOrientation(java.lang.String name,
int value,
int key)
Construct a new enum with the specified value. |
Method Summary | |
AxisOrientation |
absolute()
Returns the "absolute" orientation of this axis. |
int |
compareTo(java.lang.Object ao)
Compares this AxisOrientation with the specified orientation.
|
static AxisOrientation |
getEnum(int value)
Return the enum for the specified value. |
java.lang.String |
getName(java.util.Locale locale)
Returns this enum's name in the specified locale. |
private int |
getOrder()
Returns the order for this axis orientation (i.e. the index in the ORDER table). |
AxisOrientation |
inverse()
Returns the opposite orientation of this axis. |
private java.lang.Object |
readResolve()
Use a single instance of AxisOrientation after deserialization.
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final long serialVersionUID
public static final AxisOrientation OTHER
CS_AxisOrientationEnum.CS_AO_Other
public static final AxisOrientation NORTH
CS_AxisOrientationEnum.CS_AO_North
public static final AxisOrientation SOUTH
CS_AxisOrientationEnum.CS_AO_South
public static final AxisOrientation EAST
CS_AxisOrientationEnum.CS_AO_East
public static final AxisOrientation WEST
CS_AxisOrientationEnum.CS_AO_West
public static final AxisOrientation UP
CS_AxisOrientationEnum.CS_AO_Up
public static final AxisOrientation DOWN
CS_AxisOrientationEnum.CS_AO_Down
public static final AxisOrientation FUTURE
public static final AxisOrientation PAST
private static final int LAST_PAIRED_VALUE
private static final AxisOrientation[] ENUMS
private static final AxisOrientation[] ORDER
compareTo(java.lang.Object)
implementation.
private final transient int key
readResolve()
canonicalize enums according their
#value
. Furthermore, its value is implementation-dependent (which is
an other raison why it should not be serialized).
Constructor Detail |
private AxisOrientation(java.lang.String name, int value, int key)
Method Detail |
public static AxisOrientation getEnum(int value) throws java.util.NoSuchElementException
CS_AxisOrientationEnum
.
value
- The enum value.
java.util.NoSuchElementException
- if there is no enum for the specified value.public java.lang.String getName(java.util.Locale locale)
locale
- The locale, or null
for the default locale.
public AxisOrientation inverse()
public AxisOrientation absolute()
Math.abs(int)
method
in that "negative" orientation (SOUTH
, WEST
, DOWN
,
PAST
) are changed for their positive counterpart (NORTH
,
EAST
, UP
, FUTURE
). More specifically, the
following conversion table is applied.
Orientation | Absolute value |
---|---|
NORTH | NORTH |
SOUTH | NORTH |
EAST | EAST |
WEST | EAST |
UP | UP |
DOWN | UP |
FUTURE | FUTURE |
PAST | FUTURE |
OTHER | OTHER |
public int compareTo(java.lang.Object ao)
AxisOrientation
with the specified orientation.
The natural ordering is defined as (EAST-WEST), (NORTH-SOUTH),
(UP-DOWN), (FUTURE-PAST) and OTHER, which is the ordering for a
(x,y,z,t) coordinate system.
Two AxisOrientation
that are among the same axis but with an
opposite direction (e.g. EAST vs WEST) are considered equal by this method.
compareTo
in interface java.lang.Comparable
ao
- An AxisOrientation
object to be compared with.
java.lang.ClassCastException
- if ao
is not an AxisOrientation
object.private int getOrder()
ORDER
table).
private java.lang.Object readResolve() throws java.io.ObjectStreamException
AxisOrientation
after deserialization.
It allow client code to test enum1==enum2
instead of
enum1.equals(enum2)
.
java.io.ObjectStreamException
- is deserialization failed.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |