| java.lang.Object org.geotools.resources.Utilities
Utilities | final public class Utilities (Code) | | A set of miscellaneous methods.
since: 2.0 version: $Id: Utilities.java 27862 2007-11-12 19:51:19Z desruisseaux $ author: Martin Desruisseaux |
equals | public static boolean equals(Object object1, Object object2)(Code) | | Convenience method for testing two objects for equality. One or both objects may be null.
|
getLogRecord | public static LogRecord getLogRecord(Throwable error)(Code) | | Returns a log record for the specified exception.
|
getShortClassName | public static String getShortClassName(Object object)(Code) | | 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 ). A short class name for the specified object. |
getShortName | public static String getShortName(Class classe)(Code) | | 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 ). A short class name for the specified object.Class.getSimpleName |
recoverableException | public static void recoverableException(String paquet, Class classe, String method, Throwable error)(Code) | | Invoked when a recoverable error occurs. This exception is similar to
Utilities.unexpectedException 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 informationmay be used to fetch an appropriate Logger forlogging the error. Parameters: classe - The class where the error occurred. Parameters: method - The method name where the error occurred. Parameters: error - The error. |
sameInterfaces | public static boolean sameInterfaces(Class object1, Class object2, Class base)(Code) | | 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,
.class))
|
spaces | public static String spaces(int length)(Code) | | 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. A string of length length filled with white spaces. |
unexpectedException | public static void unexpectedException(String paquet, String classe, String method, Throwable error)(Code) | | Invoked when an unexpected error occurs.
Parameters: paquet - The package where the error occurred. This informationmay be used to fetch an appropriate Logger forlogging the error. Parameters: classe - The class name where the error occurred. Parameters: method - The method name where the error occurred. Parameters: error - The error.org.geotools.util.Logging.unexpectedException |
|
|