org.geotools.resources
Class Utilities

java.lang.Object
  extended by org.geotools.resources.Utilities

Deprecated. Moved to org.geotools.util package.

@Deprecated
public final class Utilities
extends java.lang.Object

A set of miscellaneous methods.

Since:
2.0
Version:
$Id: Utilities.java 31445 2008-09-07 18:14:23Z desruisseaux $
Author:
Martin Desruisseaux (IRD)

Method Summary
static boolean deepEquals(java.lang.Object object1, java.lang.Object object2)
          Deprecated. Convenience method for testing two objects for equality.
static int deepHashCode(java.lang.Object object)
          Deprecated. Returns a hash code for the specified object, which may be an array.
static java.lang.String deepToString(java.lang.Object object)
          Deprecated. Returns a string representation of the specified object, which may be an array.
static
<E> java.util.Queue<E>
emptyQueue()
          Deprecated. Returns a queue which is always empty and accepts no element.
static boolean equals(java.lang.Object object1, java.lang.Object object2)
          Deprecated. Convenience method for testing two objects for equality.
static java.util.logging.LogRecord getLogRecord(java.lang.Throwable error)
          Deprecated. Will be deleted after we removed the recoverableException(java.lang.String, java.lang.Class, java.lang.String, java.lang.Throwable) deprecated method.
static java.lang.String getShortClassName(java.lang.Object object)
          Deprecated. Moved to Classes.
static java.lang.String getShortName(java.lang.Class<?> classe)
          Deprecated. Moved to Classes.
static void recoverableException(java.lang.String paquet, java.lang.Class<?> classe, java.lang.String method, java.lang.Throwable error)
          Deprecated. Moved to Logging.recoverableException(java.util.logging.Logger, java.lang.Class, java.lang.String, java.lang.Throwable).
static
<T> boolean
sameInterfaces(java.lang.Class<? extends T> object1, java.lang.Class<? extends T> object2, java.lang.Class<T> base)
          Deprecated. Moved to Classes.
static java.lang.String spaces(int length)
          Deprecated. Returns a string of the specified length filled with white spaces.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

equals

public static boolean equals(java.lang.Object object1,
                             java.lang.Object object2)
Deprecated. 
Convenience method for testing two objects for equality. One or both objects may be null.


deepEquals

public static boolean deepEquals(java.lang.Object object1,
                                 java.lang.Object object2)
Deprecated. 
Convenience method for testing two objects for equality. One or both objects may be null. If both are non-null and are arrays, then every array elements will be compared.

This method may be useful when the objects may or may not be array. If they are known to be arrays, consider using Arrays.deepEquals(Object[],Object[]) or one of its primitive counter-part instead.

Rules for choosing an equals or deepEquals method


deepHashCode

public static int deepHashCode(java.lang.Object object)
Deprecated. 
Returns a hash code for the specified object, which may be an array. This method returns one of the following values:

This method should be invoked only if the object type is declared exactly as Object, not as some subtype like Object[], String or float[]. In the later cases, use the appropriate Arrays method instead.


deepToString

public static java.lang.String deepToString(java.lang.Object object)
Deprecated. 
Returns a string representation of the specified object, which may be an array. This method returns one of the following values:

This method should be invoked only if the object type is declared exactly as Object, not as some subtype like Object[], Number or float[]. In the later cases, use the appropriate Arrays method instead.


emptyQueue

public static <E> java.util.Queue<E> emptyQueue()
Deprecated. 
Returns a queue which is always empty and accepts no element.

See Also:
Collections.emptyList(), Collections.emptySet()

sameInterfaces

public static <T> boolean sameInterfaces(java.lang.Class<? extends T> object1,
                                         java.lang.Class<? extends T> object2,
                                         java.lang.Class<T> base)
Deprecated. Moved to Classes.

Returns true if the two specified objects implements exactly the same set of interfaces. Only interfaces assignable to base are compared. Declaration order doesn't matter. For example in ISO 19111, different interfaces exist for different coordinate system geometries (CartesianCS, PolarCS, etc.). We can check if two CS implementations has the same geometry with the following code:
if (sameInterfaces(cs1, cs2, CoordinateSystem.class))


spaces

public static java.lang.String spaces(int length)
Deprecated. 
Returns a string of the specified length filled with white spaces. This method tries to return a pre-allocated string if possible.

Parameters:
length - The string length. Negative values are clamped to 0.
Returns:
A string of length length filled with white spaces.

getShortName

public static java.lang.String getShortName(java.lang.Class<?> classe)
Deprecated. Moved to Classes.

Returns a short class name for the specified class. This method will omit the package name. For example, it will return "String" instead of "java.lang.String" for a String object. It will also name array according Java language usage, for example "double[]" instead of "[D".

Parameters:
classe - The object class (may be null).
Returns:
A short class name for the specified object.

getShortClassName

public static java.lang.String getShortClassName(java.lang.Object object)
Deprecated. Moved to Classes.

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 String object.

Parameters:
object - The object (may be null).
Returns:
A short class name for the specified object.

recoverableException

public static void recoverableException(java.lang.String paquet,
                                        java.lang.Class<?> classe,
                                        java.lang.String method,
                                        java.lang.Throwable error)
Deprecated. Moved to Logging.recoverableException(java.util.logging.Logger, java.lang.Class, java.lang.String, java.lang.Throwable).

Invoked when a recoverable error occurs. This exception is similar to unexpectedException except that it doesn't log the stack trace and uses a lower logging level.

Parameters:
paquet - The package where the error occurred. This information may be used to fetch an appropriate Logger for logging the error.
classe - The class where the error occurred.
method - The method name where the error occurred.
error - The error.

getLogRecord

public static java.util.logging.LogRecord getLogRecord(java.lang.Throwable error)
Deprecated. Will be deleted after we removed the recoverableException(java.lang.String, java.lang.Class, java.lang.String, java.lang.Throwable) deprecated method.

Returns a log record for the specified exception.



Copyright © 1996-2010 Geotools. All Rights Reserved.