Note 1:
This class inherits {@linkplain #x x} and {@linkplain #y y} fields. But despite their names,they don't need to be oriented toward {@linkplain org.opengis.referencing.cs.AxisDirection#EAST East} and {@linkplain org.opengis.referencing.cs.AxisDirection#NORTH North}. The (x,y) axis can have any orientation and should be understood as "ordinate 0" and "ordinate 1" values instead. This is not specific to this implementation; in Java2D too, the visual axis orientation depend on the {@linkplain java.awt.Graphics2D#getTransform affine transform in the graphics context}.The rational for avoiding axis orientation restriction is that other {@link DirectPosition}implementation do not have such restriction, and it would be hard to generalize (what to do with {@linkplain org.opengis.referencing.cs.AxisDirection#NORTH_EAST North-East} direction?).
Note 2:
Do not mix instances of this class with ordinary {@link Point2D} instances in a{@link java.util.HashSet} or as {@link java.util.HashMap} keys. It is not possible tomeet both {@link Point2D#hashCode} and {@link DirectPosition#hashCode} contract, and this classchoose to implements the later. Concequently, {@link #hashCode} is inconsistent with{@link Point2D#equals} (but is consistent with {@link DirectPosition#equals}).@since 2.0 @source $URL$ @version $Id$ @author Martin Desruisseaux (IRD) @see DirectPosition1D @see GeneralDirectPosition @see java.awt.geom.Point2DIn other words, it is safe to add instances of {@code DirectPosition2D} in a{@code HashSet
}, but it is unsafe to add them in a {@code HashSet }. Collections that do not rely on {@link Object#hashCode}, like {@link java.util.ArrayList}, are safe in all cases.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|