/** Formats the time origin. */ @Override protected String formatTo(final Formatter formatter) { formatter.append(origin); return WKTKeywords.TimeOrigin; } }
/** * Returns a string representation of the warning messages if the default locale. * The locale used by this method is given by {@link #getLocale()}. * This is usually the locale given to the {@link WKTFormat} constructor. * * @return a string representation of the warning messages. */ @Override public String toString() { return toString(errorLocale); }
/** * If the given character is an opening bracket, returns the matching closing bracket. * Otherwise returns -1. */ final int matchingBracket(final int c) { return matching(brackets, c); }
/** * Creates a new formatter instance with the default configuration. */ public Formatter() { this(Convention.DEFAULT, Symbols.getDefault(), Constants.DEFAULT_INDENTATION); }
/** * Throws the exception in all cases. * * @return never return. * @throws UnformattableObjectException always thrown. */ @Override public String toWKT() throws UnformattableObjectException { throw new UnformattableObjectException(); } }
/** * Closes the element opened by {@link #openElement(boolean, String)}. * * @param newLine {@code true} for invoking {@link #newLine()} last. */ private void closeElement(final boolean newLine) { buffer.appendCodePoint(symbols.getClosingBracket(0)); if (newLine) { newLine(); } }
/** * Tests {@link Transliterator#toShortAxisName(CoordinateSystem, AxisDirection, String)}. */ @Test public void testToShortAxisName() { assertShortAxisNameEquals("Latitude", new Geographic(AxisNames.GEODETIC_LATITUDE, "φ")); assertShortAxisNameEquals("Spherical latitude", new Geocentric(AxisNames.SPHERICAL_LATITUDE, "Ω")); assertShortAxisNameEquals("Longitude", new Geographic(AxisNames.GEODETIC_LONGITUDE, "λ")); assertShortAxisNameEquals("Spherical longitude", new Geocentric(AxisNames.SPHERICAL_LONGITUDE, "θ")); }
/** * Tests {@link Transliterator#toLatinAbbreviation(CoordinateSystem, AxisDirection, String)}. */ @Test public void testToLatinAbbreviation() { assertAbbreviationEquals("B", new Geographic(AxisNames.GEODETIC_LATITUDE, "φ")); assertAbbreviationEquals("U", new Geocentric(AxisNames.SPHERICAL_LATITUDE, "Ω")); assertAbbreviationEquals("L", new Geographic(AxisNames.GEODETIC_LONGITUDE, "λ")); assertAbbreviationEquals("V", new Geocentric(AxisNames.SPHERICAL_LONGITUDE, "θ")); }
/** * Returns an immutable copy of this set of colors, or {@code this} if this instance is already immutable. */ final Colors immutable() { if (isImmutable) { return this; } final Colors clone = clone(); clone.isImmutable = true; return clone; }
/** * Implementation of public {@code setInvalidWKT(…)} methods. * * <div class="note"><b>Note:</b> the message is stored as an {@link InternationalString} * in order to defer the actual message formatting until needed.</div> */ private void setInvalidWKT(final String invalidElement, final Exception cause) { warnings().add(Errors.formatInternational(Errors.Keys.CanNotRepresentInFormat_2, "WKT", invalidElement), cause, null); highlightError = true; }
/** * Reports a non-fatal warning that occurred while parsing a WKT. * * @param parent the parent element, or {@code null} if unknown. * @param element the element that we can not parse, or {@code null} if unknown. * @param message the message. Can be {@code null} only if {@code ex} is non-null. * @param ex the non-fatal exception that occurred while parsing the element, or {@code null}. */ final void warning(final Element parent, final Element element, final InternationalString message, final Exception ex) { warning(parent, (element != null) ? element.keyword : null, message, ex); }
/** * Parses the next element in the specified <cite>Well Know Text</cite> (WKT) tree. * * @param element the element to be parsed. * @return the parsed object, or {@code null} if the element is not recognized. * @throws ParseException if the element can not be parsed. */ @Override Object parseObject(final Element element) throws ParseException { return parseMathTransform(element, true); }
/** * Returns an immutable copy of this set of symbols, or {@code this} if this instance is already immutable. */ final Symbols immutable() { if (isImmutable) { return this; } final Symbols clone = clone(); clone.isImmutable = true; return clone; }
@Override protected String formatTo(final Formatter formatter) { formatter.append(accuracy); return WKTKeywords.OperationAccuracy; } });
/** * If the given character is an opening quote, returns the matching closing quote. * Otherwise returns -1. */ final int matchingQuote(final int c) { return matching(quotes, c); }
/** * Formats the {@code ORDER[…]} element. */ @Override protected String formatTo(final Formatter formatter) { formatter.append(index); return WKTKeywords.Order; } }
/** Formats the citation. */ @Override protected String formatTo(final Formatter formatter) { formatter.append(identifier, ElementKind.CITATION); return WKTKeywords.Citation; } }
@Override protected String formatTo(final Formatter formatter) { formatter.append(urn, null); return WKTKeywords.URI; } });