com.maryanovsky.gwtutils.client
Class Utils

java.lang.Object
  extended by com.maryanovsky.gwtutils.client.Utils

public class Utils
extends Object

A general utility class.

Author:
Maryanovsky Alexander

Constructor Summary
Utils()
           
 
Method Summary
static boolean areEqual(Object o1, Object o2)
          Returns whether the two specified objects are equal.
static String[] clone(String[] arr)
          Creates a shallow copy of the specified String array.
static boolean getBooleanProperty(JavaScriptObject object, String propertyName)
          Returns the specified boolean property of the specified JavaScript object.
static String getHostname(String url)
          Returns the hostname in the specified URL.
static int getIntProperty(JavaScriptObject object, String propertyName)
          Returns the specified integer property of the specified JavaScript object.
static String getStringProperty(JavaScriptObject object, String propertyName)
          Returns the specified string property of the specified JavaScript object.
static int hashCode(double d)
          Returns the hash code for the specified double value.
static int hashCode(int hash1, int hash2)
          Returns a hash code for the two specified hash codes.
static int hashCode(long l)
          Returns the hash code for the specified long value.
static int hashCode(Object o)
          Returns a hash code for the specified object, or if the object is null, returns 0.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Utils

public Utils()
Method Detail

getHostname

public static String getHostname(String url)
Returns the hostname in the specified URL. Returns the host page base URL if the URL is relative.


clone

public static String[] clone(String[] arr)
Creates a shallow copy of the specified String array.


hashCode

public static int hashCode(Object o)
Returns a hash code for the specified object, or if the object is null, returns 0.


hashCode

public static int hashCode(double d)
Returns the hash code for the specified double value.


hashCode

public static int hashCode(long l)
Returns the hash code for the specified long value.


hashCode

public static int hashCode(int hash1,
                           int hash2)
Returns a hash code for the two specified hash codes.


areEqual

public static boolean areEqual(Object o1,
                               Object o2)
Returns whether the two specified objects are equal.


getStringProperty

public static String getStringProperty(JavaScriptObject object,
                                       String propertyName)
Returns the specified string property of the specified JavaScript object.


getIntProperty

public static int getIntProperty(JavaScriptObject object,
                                 String propertyName)
Returns the specified integer property of the specified JavaScript object.


getBooleanProperty

public static boolean getBooleanProperty(JavaScriptObject object,
                                         String propertyName)
Returns the specified boolean property of the specified JavaScript object.