org.geotools.resources.Utilities类的使用及代码示例

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

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

Utilities介绍

[英]A set of miscellaneous methods.
[中]各种各样的方法。

代码示例

代码示例来源:origin: org.geotools/gt2-main

public boolean equals(Object obj) {
  if (this == obj) {
    return true;
  }
  if (obj instanceof AnchorPointImpl) {
    AnchorPointImpl other = (AnchorPointImpl) obj;
    return Utilities.equals(this.anchorPointX, other.anchorPointX)
    && Utilities.equals(this.anchorPointY, other.anchorPointY);
  }
  return false;
}

代码示例来源:origin: org.geotools/gt2-metadata

/**
 * Checks the type of the specified object. The default implementation ensure
 * that the object is assignable to the type specified at construction time.
 *
 * @param  element the object to check, or {@code null}.
 * @throws IllegalArgumentException if the specified element is not of the expected type.
 */
protected void ensureValidType(final Object element) throws IllegalArgumentException {
  if (element!=null && !type.isInstance(element)) {
    throw new IllegalArgumentException(Errors.format(ErrorKeys.ILLEGAL_CLASS_$2,
         Utilities.getShortClassName(element), Utilities.getShortName(type)));
  }
}

代码示例来源:origin: org.geotools/gt2-metadata

/**
 * Sets the indentation to the specified value.
 */
public void setIndentation(final int width) {
  synchronized (lock) {
    margin = Utilities.spaces(width);
  }
}

代码示例来源:origin: org.geotools/gt2-render

/**
   * Returns a string representation of this style.
   */
  public String toString() {
    return Utilities.getShortClassName(this) + '[' + contour + ']';
  }
}

代码示例来源:origin: org.geotools/gt2-metadata

/**
 * Constructs an exception with an error message formatted for the specified class.
 *
 * @param classe The unexpected implementation class.
 */
public UnsupportedImplementationException(final Class classe) {
  // TODO: Provides a localized message.
  super(Utilities.getShortName(classe));
}

代码示例来源:origin: org.geotools/gt2-widgets-swing

hasPrintedWarning=true;
if (!Utilities.equals(source, lastSource)) {
  out.println();
  out.println(source!=null ? source : Vocabulary.format(VocabularyKeys.UNTITLED));
    prefix=buffer.toString();
    buffer.setLength(0);
    second=Utilities.spaces(prefix.length());

代码示例来源:origin: org.geotools/gt2-metadata

buffer.append(Utilities.spaces(Math.max(1, 7-status.length())))
   .append('(').append(Utilities.getShortName(category));
if (key != null) {
  buffer.append(", ").append(key);
  buffer.append(' ').append(Utilities.getShortName(type)).append('.');

代码示例来源:origin: org.geotools/gt2-coverageio

Utilities.recoverableException("org.geotools.image.io", PaletteFactory.class, caller, e);
return null;

代码示例来源:origin: org.geotools/gt2-coverage

/**
   * Returns a string representation of this dimension.
   */
  //@Override
  public String toString() {
  return Utilities.getShortClassName(this) + "[width=" + width + ",height=" + height +
        ",numBands=" + numBands + ']';
  }
}

代码示例来源:origin: org.geotools/gt2-metadata

/**
 * Returns a short class name for the specified object. This method will
 * omit the package name. For example, it will return "String" instead
 * of "java.lang.String" for a {@link String} object.
 *
 * @param  object The object (may be {@code null}).
 * @return A short class name for the specified object.
 */
public static String getShortClassName(final Object object) {
  return getShortName(object!=null ? object.getClass() : null);
}

代码示例来源:origin: org.geotools/gt2-metadata

Utilities.recoverableException("org.geotools.util", Logging.class,
    "redirectToCommonsLogging", error);

代码示例来源:origin: org.geotools/gt2-main

public boolean equals(Object obj) {
  if (this == obj) {
    return true;
  }
  if (obj instanceof PointPlacementImpl) {
    PointPlacementImpl other = (PointPlacementImpl) obj;
    return Utilities.equals(anchorPoint, other.anchorPoint)
    && Utilities.equals(displacement, other.displacement)
    && Utilities.equals(rotation, other.rotation);
  }
  return false;
}

代码示例来源:origin: org.geotools/gt2-metadata

/**
 * Checks the type of the specified object. The default implementation ensure
 * that the object is assignable to the type specified at construction time.
 *
 * @param  element the object to check, or {@code null}.
 * @throws IllegalArgumentException if the specified element is not of the expected type.
 */
protected void ensureValidType(final Object element) throws IllegalArgumentException {
  if (element!=null && !type.isInstance(element)) {
    throw new IllegalArgumentException(Errors.format(ErrorKeys.ILLEGAL_CLASS_$2,
         Utilities.getShortClassName(element), Utilities.getShortName(type)));
  }
}

代码示例来源:origin: org.geotools/gt2-widgets-swing

/**
 * Returns a character string representing this object.
 */
public String toString() {
  return Utilities.getShortClassName(this) + '[' + Utilities.getShortClassName(logicalShape) + ']';
}

代码示例来源:origin: org.geotools/gt2-metadata

/**
   * Returns the rank (in the {@link #CLASS_RANK} array) of the specified class.
   */
  private static int getRank(final Class c) {
    for (int i=0; i<CLASS_RANK.length; i++) {
      if (CLASS_RANK[i].isAssignableFrom(c)) {
        return i;
      }
    }
    throw new IllegalArgumentException(Utilities.getShortName(c));
  }
}

代码示例来源:origin: org.geotools/gt2-metadata

/**
 * Creates a new table writer with the specified
 * amount of spaces as column separator.
 *
 * @param out Writer object to provide the underlying stream,
 *        or {@code null} if there is no underlying stream.
 *        If {@code out} is null, then the {@link #toString}
 *        method is the only way to get the table's content.
 * @param spaces Amount of white spaces to use as column separator.
 */
public TableWriter(final Writer out, final int spaces) {
  this(out, Utilities.spaces(spaces));
}

代码示例来源:origin: org.geotools/gt2-main

public boolean equals(Object obj) {
   if (this == obj) {
    return true;
  }
    
  if (obj instanceof ImageOutlineImpl) {
    ImageOutlineImpl other = (ImageOutlineImpl) obj;
    return Utilities.equals(symbolizer, other.symbolizer);
  }
  
  return false;
}

代码示例来源:origin: org.geotools/gt2-coverage

/**
 * Returns the interpolation name for the specified interpolation object.
 * This method tries to infer the name from the object's class name.
 *
 * @param Interpolation The interpolation object.
 */
public static String getInterpolationName(final Interpolation interp) {
  final String prefix = "Interpolation";
  for (Class classe = interp.getClass(); classe!=null; classe=classe.getSuperclass()) {
    String name = Utilities.getShortName(classe);
    int index = name.lastIndexOf(prefix);
    if (index >= 0) {
      return name.substring(index + prefix.length());
    }
  }
  return Utilities.getShortClassName(interp);
}

代码示例来源:origin: org.geotools/gt2-render

/**
   * Returns a string representation of this style.
   */
  public String toString() {
    return Utilities.getShortClassName(this) + '[' + shape + ']';
  }
}

代码示例来源:origin: org.geotools/gt2-main

/**
 * Format an error message saying that the specified factory is not yet supported.
 * The error message will be given to a {@link FactoryNotFoundException}.
 *
 * @param type The factory type requested by the users.
 */
private static String unsupportedFactory(final Class type) {
  return Errors.format(ErrorKeys.FACTORY_NOT_FOUND_$1, Utilities.getShortName(type));
}

相关文章