@Test public void testPredefined() { assertNull(getPredefined("Dummy", null)); assertSame(GEODETIC_LATITUDE, getPredefined("\u03C6", null)); assertSame(GEODETIC_LONGITUDE, getPredefined("\u03BB", null)); assertSame(ELLIPSOIDAL_HEIGHT, getPredefined("h", null)); assertSame(GEOCENTRIC_X, getPredefined("X", AxisDirection.OTHER)); assertSame(GEOCENTRIC_Y, getPredefined("Y", AxisDirection.EAST)); assertSame(GEOCENTRIC_Z, getPredefined("Z", AxisDirection.NORTH)); assertSame(LONGITUDE, getPredefined("Lon", AxisDirection.EAST)); assertSame(LATITUDE, getPredefined("Lat", AxisDirection.NORTH)); assertSame(X, getPredefined("X", AxisDirection.EAST)); assertSame(Y, getPredefined("Y", AxisDirection.NORTH)); assertSame(Z, getPredefined("Z", AxisDirection.UP)); assertSame(LATITUDE, getPredefined("Latitude", null)); assertSame(LONGITUDE, getPredefined("Longitude", null)); assertSame(GEODETIC_LATITUDE, getPredefined("Geodetic latitude", null)); assertSame(GEODETIC_LONGITUDE, getPredefined("Geodetic longitude", null)); assertSame(NORTHING, getPredefined("Northing", null)); assertSame(NORTHING, getPredefined("N", null)); assertSame(EASTING, getPredefined("Easting", null)); assertSame(EASTING, getPredefined("E", null)); assertSame(SOUTHING, getPredefined("Southing", null)); assertSame(SOUTHING, getPredefined("S", null)); assertSame(WESTING, getPredefined("Westing", null)); assertSame(WESTING, getPredefined("W", null)); assertSame(GEOCENTRIC_X, getPredefined("X", null)); assertSame(GEOCENTRIC_Y, getPredefined("Y", null)); assertSame(GEOCENTRIC_Z, getPredefined("Z", null)); assertSame(X, getPredefined("x", null)); assertSame(Y, getPredefined("y", null)); assertSame(Z, getPredefined("z", null)); }
public static DefaultCoordinateSystemAxis getPredefined(String name, AxisDirection direction) { ensureNonNull("name", name); name = name.trim(); DefaultCoordinateSystemAxis found = null; for (int i=0; i<PREDEFINED_COUNT; i++) { final DefaultCoordinateSystemAxis candidate = PREDEFINED[i]; if (direction != null && !direction.equals(candidate.getDirection())) { continue; } if (candidate.abbreviation.equals(name)) { return candidate; } if (found == null && candidate.nameMatches(name)) { if (candidate == GEODETIC_LONGITUDE || candidate == GEODETIC_LATITUDE) { if (!name.toLowerCase().startsWith("geodetic")) { continue; } } found = candidate; } } return found; }
DefaultCoordinateSystemAxis extends AbstractIdentifiedObject implements CoordinateSystemAxis { public static DefaultCoordinateSystemAxis getPredefined(String name, AxisDirection direction) { ensureNonNull("name", name); name = name.trim(); DefaultCoordinateSystemAxis found = null; for (int i=0; i<PREDEFINED_COUNT; i++) { final DefaultCoordinateSystemAxis candidate = PREDEFINED[i]; if (direction != null && !direction.equals(candidate.getDirection())) { continue; } if (candidate.abbreviation.equals(name)) { return candidate; } if (found == null && candidate.nameMatches(name)) { if (candidate == GEODETIC_LONGITUDE || candidate == GEODETIC_LATITUDE) { if (!name.toLowerCase().startsWith("geodetic")) { continue; } } found = candidate; } } return found; } }
DefaultCoordinateSystemAxis extends AbstractIdentifiedObject implements CoordinateSystemAxis { public static DefaultCoordinateSystemAxis getPredefined(String name, AxisDirection direction) { ensureNonNull("name", name); name = name.trim(); DefaultCoordinateSystemAxis found = null; for (int i=0; i<PREDEFINED_COUNT; i++) { final DefaultCoordinateSystemAxis candidate = PREDEFINED[i]; if (direction != null && !direction.equals(candidate.getDirection())) { continue; } if (candidate.abbreviation.equals(name)) { return candidate; } if (found == null && candidate.nameMatches(name)) { if (candidate == GEODETIC_LONGITUDE || candidate == GEODETIC_LATITUDE) { if (!name.toLowerCase().startsWith("geodetic")) { continue; } } found = candidate; } } return found; } DefaultCoordinateSystemAxis(final CoordinateSystemAxis axis);  DefaultCoordinateSystemAxis(final Map<String,?> properties,
                                       final String        abbreviation,
                                       final AxisDirection direction,
                                       final Unit<?>       unit,
                                       final double        minimum,
                                       final double        maximum,
                                       final RangeMeaning  rangeMeaning);  DefaultCoordinateSystemAxis(final Map<String,?> properties,
                                       final String        abbreviation,
                                       final AxisDirection direction,
                                       final Unit<?>       unit);  DefaultCoordinateSystemAxis(final String        abbreviation,
                                       final AxisDirection direction,
                                       final Unit<?>       unit);  DefaultCoordinateSystemAxis(final InternationalString name,
                                       final String        abbreviation,
                                       final AxisDirection direction,
                                       final Unit<?>       unit); private  DefaultCoordinateSystemAxis(final int           name,
                                        final String        abbreviation,
                                        final AxisDirection direction,
                                        final Unit<?>       unit); }
DefaultCoordinateSystemAxis extends AbstractIdentifiedObject implements CoordinateSystemAxis { public static DefaultCoordinateSystemAxis getPredefined(String name, AxisDirection direction) { ensureNonNull("name", name); name = name.trim(); DefaultCoordinateSystemAxis found = null; for (int i=0; i<PREDEFINED_COUNT; i++) { final DefaultCoordinateSystemAxis candidate = PREDEFINED[i]; if (direction != null && !direction.equals(candidate.getDirection())) { continue; } if (candidate.abbreviation.equals(name)) { return candidate; } if (found == null && candidate.nameMatches(name)) { if (candidate == GEODETIC_LONGITUDE || candidate == GEODETIC_LATITUDE) { if (!name.toLowerCase().startsWith("geodetic")) { continue; } } found = candidate; } } return found; } DefaultCoordinateSystemAxis(final CoordinateSystemAxis axis);  DefaultCoordinateSystemAxis(final Map<String,?> properties,
                                       final String        abbreviation,
                                       final AxisDirection direction,
                                       final Unit<?>       unit,
                                       final double        minimum,
                                       final double        maximum,
                                       final RangeMeaning  rangeMeaning);  DefaultCoordinateSystemAxis(final Map<String,?> properties,
                                       final String        abbreviation,
                                       final AxisDirection direction,
                                       final Unit<?>       unit);  DefaultCoordinateSystemAxis(final String        abbreviation,
                                       final AxisDirection direction,
                                       final Unit<?>       unit);  DefaultCoordinateSystemAxis(final InternationalString name,
                                       final String        abbreviation,
                                       final AxisDirection direction,
                                       final Unit<?>       unit); private  DefaultCoordinateSystemAxis(final int           name,
                                        final String        abbreviation,
                                        final AxisDirection direction,
                                        final Unit<?>       unit); static DefaultCoordinateSystemAxis getPredefined(String name, AxisDirection direction); static AxisDirection getDirection(String direction); AxisDirection getDirection(); String getAbbreviation(); Unit<?> getUnit(); double getMinimumValue(); double getMaximumValue(); RangeMeaning getRangeMeaning(); static boolean isCompassDirection(final AxisDirection direction); static double getAngle(final AxisDirection source, final AxisDirection target); static boolean perpendicular(final AxisDirection first, final AxisDirection second); @Override boolean nameMatches(final String name); @Override boolean equals(final AbstractIdentifiedObject object, final boolean compareMetadata); @Override int hashCode(); }
DefaultCoordinateSystemAxis extends AbstractIdentifiedObject implements CoordinateSystemAxis { public static DefaultCoordinateSystemAxis getPredefined(String name, AxisDirection direction) { ensureNonNull("name", name); name = name.trim(); DefaultCoordinateSystemAxis found = null; for (int i=0; i<PREDEFINED_COUNT; i++) { final DefaultCoordinateSystemAxis candidate = PREDEFINED[i]; if (direction != null && !direction.equals(candidate.getDirection())) { continue; } if (candidate.abbreviation.equals(name)) { return candidate; } if (found == null && candidate.nameMatches(name)) { if (candidate == GEODETIC_LONGITUDE || candidate == GEODETIC_LATITUDE) { if (!name.toLowerCase().startsWith("geodetic")) { continue; } } found = candidate; } } return found; } DefaultCoordinateSystemAxis(final CoordinateSystemAxis axis);  DefaultCoordinateSystemAxis(final Map<String,?> properties,
                                       final String        abbreviation,
                                       final AxisDirection direction,
                                       final Unit<?>       unit,
                                       final double        minimum,
                                       final double        maximum,
                                       final RangeMeaning  rangeMeaning);  DefaultCoordinateSystemAxis(final Map<String,?> properties,
                                       final String        abbreviation,
                                       final AxisDirection direction,
                                       final Unit<?>       unit);  DefaultCoordinateSystemAxis(final String        abbreviation,
                                       final AxisDirection direction,
                                       final Unit<?>       unit);  DefaultCoordinateSystemAxis(final InternationalString name,
                                       final String        abbreviation,
                                       final AxisDirection direction,
                                       final Unit<?>       unit); private  DefaultCoordinateSystemAxis(final int           name,
                                        final String        abbreviation,
                                        final AxisDirection direction,
                                        final Unit<?>       unit); static DefaultCoordinateSystemAxis getPredefined(String name, AxisDirection direction); static AxisDirection getDirection(String direction); AxisDirection getDirection(); String getAbbreviation(); Unit<?> getUnit(); double getMinimumValue(); double getMaximumValue(); RangeMeaning getRangeMeaning(); static boolean isCompassDirection(final AxisDirection direction); static double getAngle(final AxisDirection source, final AxisDirection target); static boolean perpendicular(final AxisDirection first, final AxisDirection second); @Override boolean nameMatches(final String name); @Override boolean equals(final AbstractIdentifiedObject object, final boolean compareMetadata); @Override int hashCode(); static final DefaultCoordinateSystemAxis GEODETIC_LONGITUDE; static final DefaultCoordinateSystemAxis GEODETIC_LATITUDE; static final DefaultCoordinateSystemAxis LONGITUDE; static final DefaultCoordinateSystemAxis LATITUDE; static final DefaultCoordinateSystemAxis ELLIPSOIDAL_HEIGHT; static final DefaultCoordinateSystemAxis GRAVITY_RELATED_HEIGHT; static final DefaultCoordinateSystemAxis ALTITUDE; static final DefaultCoordinateSystemAxis DEPTH; static final DefaultCoordinateSystemAxis GEOCENTRIC_RADIUS; static final DefaultCoordinateSystemAxis SPHERICAL_LONGITUDE; static final DefaultCoordinateSystemAxis SPHERICAL_LATITUDE; static final DefaultCoordinateSystemAxis X; static final DefaultCoordinateSystemAxis Y; static final DefaultCoordinateSystemAxis Z; static final DefaultCoordinateSystemAxis GEOCENTRIC_X; static final DefaultCoordinateSystemAxis GEOCENTRIC_Y; static final DefaultCoordinateSystemAxis GEOCENTRIC_Z; static final DefaultCoordinateSystemAxis EASTING; static final DefaultCoordinateSystemAxis WESTING; static final DefaultCoordinateSystemAxis NORTHING; static final DefaultCoordinateSystemAxis SOUTHING; static final DefaultCoordinateSystemAxis TIME; static final DefaultCoordinateSystemAxis COLUMN; static final DefaultCoordinateSystemAxis ROW; static final DefaultCoordinateSystemAxis DISPLAY_X; static final DefaultCoordinateSystemAxis DISPLAY_Y; }