|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.geotools.resources.Utilities
org.geotools.util
package.
@Deprecated public final class Utilities
A set of miscellaneous methods.
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
|
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
|
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 |
---|
public static boolean equals(java.lang.Object object1, java.lang.Object object2)
public static boolean deepEquals(java.lang.Object object1, java.lang.Object object2)
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
Object[]
(not anything else like
String[]
), consider using Arrays.deepEquals(Object[],Object[])
except
if it is known that the array elements can never be other arrays.Expression[]
, String[]
,
int[]
, etc.), use Arrays.equals(Object[],Object[])
. This
rule is applicable to arrays of primitive type too, since Arrays.equals
is
overriden with primitive counter-parts.Object
(e.g.
String
, Expression
, etc.), use equals(Object,Object)
.
Using this deepEquals
method would be an overkill since there is no chance that
String
or Expression
could be an array.Object
type and
it is known that they could be arrays, only then invoke this deepEquals
method.
In such case, make sure that the hash code is computed using deepHashCode(java.lang.Object)
for
consistency.
public static int deepHashCode(java.lang.Object object)
null
, then this method returns 0.Arrays.deepHashCode(Object[])
is invoked.Arrays.hashCode(...)
method is invoked.Object.hashCode()
is invoked.
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.
public static java.lang.String deepToString(java.lang.Object object)
Arrays.deepToString(Object[])
is invoked.Arrays.toString(...)
method is invoked.String#valueOf(String)
is invoked.
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.
public static <E> java.util.Queue<E> emptyQueue()
Collections.emptyList()
,
Collections.emptySet()
public static <T> boolean sameInterfaces(java.lang.Class<? extends T> object1, java.lang.Class<? extends T> object2, java.lang.Class<T> base)
Classes
.
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))
public static java.lang.String spaces(int length)
length
- The string length. Negative values are clamped to 0.
length
filled with white spaces.public static java.lang.String getShortName(java.lang.Class<?> classe)
Classes
.
String
object. It will also name
array according Java language usage, for example "double[]" instead
of "[D".
classe
- The object class (may be null
).
public static java.lang.String getShortClassName(java.lang.Object object)
Classes
.
String
object.
object
- The object (may be null
).
public static void recoverableException(java.lang.String paquet, java.lang.Class<?> classe, java.lang.String method, java.lang.Throwable error)
Logging.recoverableException(java.util.logging.Logger, java.lang.Class>, java.lang.String, java.lang.Throwable)
.
unexpectedException
except that it doesn't
log the stack trace and uses a lower logging level.
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.public static java.util.logging.LogRecord getLogRecord(java.lang.Throwable error)
recoverableException(java.lang.String, java.lang.Class>, java.lang.String, java.lang.Throwable)
deprecated method.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |