org.apache.sis.internal.util.Utilities类的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(8.1k)|赞(0)|评价(0)|浏览(174)

本文整理了Java中org.apache.sis.internal.util.Utilities类的一些代码示例,展示了Utilities类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Utilities类的具体详情如下:
包路径:org.apache.sis.internal.util.Utilities
类名称:Utilities

Utilities介绍

[英]Miscellaneous utilities which should not be put in public API.
[中]不应放在公共API中的其他公用设施。

代码示例

代码示例来源:origin: apache/sis

/**
   * Returns the next value to be returned, for debugging purpose only.
   */
  @Override
  public String toString() {
    return Utilities.toString(Iter.class, "next", next);
  }
}

代码示例来源:origin: apache/sis

/**
   * Tests the {@link Utilities#toUpperCase(String, Characters.Filter)} method.
   */
  @Test
  public void testToUpperCase() {
    final String expected = "WGS84";
    assertSame  (expected, Utilities.toUpperCase(expected, Characters.Filter.LETTERS_AND_DIGITS));
    assertEquals(expected, Utilities.toUpperCase("WGS 84", Characters.Filter.LETTERS_AND_DIGITS));
    assertEquals(expected, Utilities.toUpperCase("wgs 84", Characters.Filter.LETTERS_AND_DIGITS));
  }
}

代码示例来源:origin: org.apache.sis.core/sis-metadata

if (id != null) {
  final StringBuilder buffer = new StringBuilder();
  if (!Utilities.appendUnicodeIdentifier(buffer, (char) 0, id, ":-", false)) {
    return null;

代码示例来源:origin: org.apache.sis.core/sis-utility

/**
 * Formats this international string using the given formatter.
 * This method appends the string obtained by:
 *
 * <blockquote><code>
 * {@linkplain #toString(Locale) toString}(formatter.{@linkplain Formatter#locale()})
 * </code></blockquote>
 *
 * @param formatter  the formatter to use for formatting this string.
 * @param flags      a bitmask of {@link FormattableFlags} values.
 * @param width      the minimum number of characters, or -1 if none.
 * @param precision  the maximum number of characters (before expanding to the {@code width}),
 *                   or -1 for no restriction.
 */
@Override
public void formatTo(final Formatter formatter, final int flags, final int width, final int precision) {
  Utilities.formatTo(formatter, flags, width, precision, toString(formatter.locale()));
}

代码示例来源:origin: apache/sis

final PrimeMeridian meridian  = createPrimeMeridian(names, angularUnit);
final GeodeticDatum datum     = getDatumFactory().createGeodeticDatum(properties(name), ellipsoid, meridian);
name = Utilities.toUpperCase(name, Characters.Filter.LETTERS_AND_DIGITS);
lastName = datum.getName();
try {

代码示例来源:origin: apache/sis

if (id != null) {
  final StringBuilder buffer = new StringBuilder();
  if (!Utilities.appendUnicodeIdentifier(buffer, (char) 0, id, ":-", false)) {
    return null;

代码示例来源:origin: apache/sis

/**
 * Formats this international string using the given formatter.
 * This method appends the string obtained by:
 *
 * <blockquote><code>
 * {@linkplain #toString(Locale) toString}(formatter.{@linkplain Formatter#locale()})
 * </code></blockquote>
 *
 * @param formatter  the formatter to use for formatting this string.
 * @param flags      a bitmask of {@link FormattableFlags} values.
 * @param width      the minimum number of characters, or -1 if none.
 * @param precision  the maximum number of characters (before expanding to the {@code width}),
 *                   or -1 for no restriction.
 */
@Override
public void formatTo(final Formatter formatter, final int flags, final int width, final int precision) {
  Utilities.formatTo(formatter, flags, width, precision, toString(formatter.locale()));
}

代码示例来源:origin: apache/sis

/**
 * Returns a string representation of this {@code ProbeResult} for debugging purpose.
 */
@Override
public String toString() {
  return Utilities.toString(getClass(), "isSupported", isSupported, "mimeType", mimeType, "version", version);
}

代码示例来源:origin: apache/sis

datum = CommonCRS.valueOf(Utilities.toUpperCase(value, Characters.Filter.LETTERS_AND_DIGITS));
break;

代码示例来源:origin: org.apache.sis.core/sis-metadata

default: break loop;
if (!Utilities.appendUnicodeIdentifier(buffer.append(DefinitionURI.SEPARATOR), '\u0000', part, ".-", false)) {

代码示例来源:origin: apache/sis

/**
   * Formats this range using the provider formatter. This method is invoked when an
   * {@code Range} object is formatted using the {@code "%s"} conversion specifier of
   * {@link Formatter}. Users don't need to invoke this method explicitly.
   *
   * <p>If the alternate flags is present (as in {@code "%#s"}), then the range will
   * be formatted using the {@linkplain RangeFormat#isAlternateForm() alternate form}
   * for exclusive bounds.</p>
   *
   * @param  formatter  the formatter in which to format this angle.
   * @param  flags      {@link FormattableFlags#LEFT_JUSTIFY} for left alignment, or 0 for right alignment.
   * @param  width      minimal number of characters to write, padding with {@code ' '} if necessary.
   * @param  precision  maximal number of characters to write, or -1 if no limit.
   */
  @Override
  public void formatTo(final Formatter formatter, final int flags, final int width, int precision) {
    final String value;
    if (precision == 0) {
      value = "";
    } else {
      final RangeFormat format = new RangeFormat(formatter.locale(), elementType);
      format.setAlternateForm((flags & FormattableFlags.ALTERNATE) != 0);
      value = format.format(this, new StringBuffer(), null).toString();
    }
    Utilities.formatTo(formatter, flags, width, precision, value);
  }
}

代码示例来源:origin: apache/sis

/**
 * Returns a string representation of this grid.
 *
 * @return a string representation for debugging purpose.
 */
@Override
public String toString() {
  return Utilities.toString(getClass(), "file", (files.length != 0) ? files[0] : null);
}

代码示例来源:origin: org.apache.sis.storage/sis-earth-observation

datum = CommonCRS.valueOf(Utilities.toUpperCase(value, Characters.Filter.LETTERS_AND_DIGITS));
break;

代码示例来源:origin: org.apache.sis.core/sis-referencing

if (appendUnicodeIdentifier(id, '-', identifier.getCodeSpace(), "", true) |    // Really |, not ||
      appendUnicodeIdentifier(id, '-', NameMeaning.toObjectType(object.getClass()), "", false) |
      appendUnicodeIdentifier(id, '-', identifier.getCode(), "", true))
if (isUnnamed(name) || !appendUnicodeIdentifier(id, '-', name.getCode(), "", false)) {
  if (alias != null) {
    for (final GenericName a : alias) {
      if (appendUnicodeIdentifier(id, '-', a.toString(), "", false)) {
        break;

代码示例来源:origin: org.apache.sis.core/sis-utility

/**
   * Formats this range using the provider formatter. This method is invoked when an
   * {@code Range} object is formatted using the {@code "%s"} conversion specifier of
   * {@link Formatter}. Users don't need to invoke this method explicitely.
   *
   * <p>If the alternate flags is present (as in {@code "%#s"}), then the range will
   * be formatted using the {@linkplain RangeFormat#isAlternateForm() alternate form}
   * for exclusive bounds.</p>
   *
   * @param  formatter  the formatter in which to format this angle.
   * @param  flags      {@link FormattableFlags#LEFT_JUSTIFY} for left alignment, or 0 for right alignment.
   * @param  width      minimal number of characters to write, padding with {@code ' '} if necessary.
   * @param  precision  maximal number of characters to write, or -1 if no limit.
   */
  @Override
  public void formatTo(final Formatter formatter, final int flags, final int width, int precision) {
    final String value;
    if (precision == 0) {
      value = "";
    } else {
      final RangeFormat format = new RangeFormat(formatter.locale(), elementType);
      format.setAlternateForm((flags & FormattableFlags.ALTERNATE) != 0);
      value = format.format(this, new StringBuffer(), null).toString();
    }
    Utilities.formatTo(formatter, flags, width, precision, value);
  }
}

代码示例来源:origin: apache/sis

/**
   * Do not format all properties for avoiding a never-ending loop.
   */
  @Override
  public String toString() {
    return Utilities.toString(getClass(), "locale", locale, "timezone", timezone);
  }
}

代码示例来源:origin: apache/sis

if (appendUnicodeIdentifier(id, '-', identifier.getCodeSpace(), "", true) |    // Really |, not ||
      appendUnicodeIdentifier(id, '-', NameMeaning.toObjectType(object.getClass()), "", false) |
      appendUnicodeIdentifier(id, '-', identifier.getCode(), "", true))
if (isUnnamed(name) || !appendUnicodeIdentifier(id, '-', name.getCode(), "", false)) {
  if (alias != null) {
    for (final GenericName a : alias) {
      if (appendUnicodeIdentifier(id, '-', a.toString(), "", false)) {
        break;

代码示例来源:origin: apache/sis

Utilities.formatTo(formatter, flags, width, precision, value);

代码示例来源:origin: apache/sis

/**
   * Returns a string representation of this iterator for debugging purpose.
   */
  @Override
  public String toString() {
    return org.apache.sis.internal.util.Utilities.toString(getClass(), "zone", encoder.crsZone,
        "downward", downward, "yStart", yStart, "yEnd", yEnd, "gridX", gridX, "xEnd", xEnd);
  }
}

代码示例来源:origin: apache/sis

default: break loop;
if (!Utilities.appendUnicodeIdentifier(buffer.append(DefinitionURI.SEPARATOR), '\u0000', part, ".-", false)) {

相关文章