y.util
Class YUtil

java.lang.Object
  |
  +--y.util.YUtil

public final class YUtil
extends Object

This class provides some static convenience methods and temporary scratch variables.


Method Summary
static boolean getBool(Object obj)
          Converts an Object to boolean.
static double getDouble(Object obj)
          Converts an Object to double.
static int getInt(Object obj)
          Converts an Object to int.
static URL getURL(String relativePath)
          Returns the corresponding absolute URL to the given relative path.
static boolean isDoubleConvertible(Object obj)
          Checks if the given Object is convertible to a double value.
static boolean isIntConvertible(Object obj)
          Checks if the given Object is convertible to an integer value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getBool

public static boolean getBool(Object obj)
Converts an Object to boolean. If the given Object is of type Boolean it's value is returned. Otherwise false is returned.


isIntConvertible

public static boolean isIntConvertible(Object obj)
Checks if the given Object is convertible to an integer value.


isDoubleConvertible

public static boolean isDoubleConvertible(Object obj)
Checks if the given Object is convertible to a double value.


getInt

public static int getInt(Object obj)
Converts an Object to int. If the given Object is of type Integer it's value is returned. If the given Object is of type String with an int parsable value, the parsed value is returned. Otherwise 0 is returned.


getDouble

public static double getDouble(Object obj)
Converts an Object to double. If the given Object is of type Double it's value is returned. If the given Object is of type String with a double parsable value, the parsed value is returned. Otherwise 0.0 is returned.


getURL

public static URL getURL(String relativePath)
Returns the corresponding absolute URL to the given relative path. The given path must be relative to a path or jar in the current classpath.


© Copyright 2000-2003,
yWorks GmbH.
All rights reserved.

2003