|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.maryanovsky.gwtutils.client.Utils
public class Utils
A general utility class.
Constructor Summary | |
---|---|
Utils()
|
Method Summary | |
---|---|
static boolean |
areEqual(List<?> list1,
List<?> list2)
Returns whether the two specified lists are equal by value, that is, they contain equal items, in the same order. |
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 Map<String,String> |
dictionaryToMap(Dictionary dictionary)
Converts a Dictionary to a regular string-to-string map. |
static String |
escape(String s)
The JavaScript escape function. |
static boolean |
getBooleanProperty(JavaScriptObject object,
String propertyName)
Returns the specified boolean property of the specified JavaScript object. |
static double |
getDoubleProperty(JavaScriptObject object,
String propertyName)
Returns the specified floating point 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. |
JavaScriptObject |
getProperty(JavaScriptObject object,
String propertyName)
Returns the specified property of the specified JavaScript object. |
static String |
getStringProperty(JavaScriptObject object,
String propertyName)
Returns the specified string property of the specified JavaScript object. |
static Map<String,String> |
getUrlParams()
Returns the URL parameters of window.location . |
static Map<String,String> |
getUrlParams(Map<String,String> params)
Adds the URL parameters of window.location to specified map
and returns it. |
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. |
static void |
setBooleanProperty(JavaScriptObject object,
String propertyName,
boolean propertyValue)
Sets the specified boolean property of the specified JavaScript object. |
static void |
setDoubleProperty(JavaScriptObject object,
String propertyName,
double propertyValue)
Sets the specified floating point property of the specified JavaScript object. |
static void |
setIntProperty(JavaScriptObject object,
String propertyName,
int propertyValue)
Sets the specified integer property of the specified JavaScript object. |
static void |
setProperty(JavaScriptObject object,
String propertyName,
JavaScriptObject propertyValue)
Sets the specified property of the specified JavaScript object. |
static void |
setStringProperty(JavaScriptObject object,
String propertyName,
String propertyValue)
Sets the specified string property of the specified JavaScript object. |
static String |
unescape(String s)
The JavaScript unescape function. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Utils()
Method Detail |
---|
public static String getHostname(String url)
null
if
if the URL is relative.
public static String[] clone(String[] arr)
public static int hashCode(Object o)
null
, returns 0.
public static int hashCode(double d)
double
value.
public static int hashCode(long l)
long
value.
public static int hashCode(int hash1, int hash2)
public static boolean areEqual(Object o1, Object o2)
public static boolean areEqual(List<?> list1, List<?> list2)
equals
method.
public JavaScriptObject getProperty(JavaScriptObject object, String propertyName)
public static void setProperty(JavaScriptObject object, String propertyName, JavaScriptObject propertyValue)
public static String getStringProperty(JavaScriptObject object, String propertyName)
public static void setStringProperty(JavaScriptObject object, String propertyName, String propertyValue)
public static int getIntProperty(JavaScriptObject object, String propertyName)
public static void setIntProperty(JavaScriptObject object, String propertyName, int propertyValue)
public static double getDoubleProperty(JavaScriptObject object, String propertyName)
public static void setDoubleProperty(JavaScriptObject object, String propertyName, double propertyValue)
public static boolean getBooleanProperty(JavaScriptObject object, String propertyName)
public static void setBooleanProperty(JavaScriptObject object, String propertyName, boolean propertyValue)
public static Map<String,String> getUrlParams(Map<String,String> params)
window.location
to specified map
and returns it. If a parameter has been specified more than once, only
the last value is added to the map.
public static Map<String,String> getUrlParams()
window.location
. The returned
map is unmodifiable. If a parameter has been specified more than once,
only the last value appears in the map.
public static Map<String,String> dictionaryToMap(Dictionary dictionary)
Dictionary
to a regular string-to-string map.
public static String escape(String s)
public static String unescape(String s)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |