public class Util extends Object
| Constructor and Description |
|---|
Util() |
| Modifier and Type | Method and Description |
|---|---|
static int |
constrain(int value,
int min,
int max)
Constrains the value by a minimum and max value.
|
static List |
createList(Object... element)
Creates a new list and adds the element(s).
|
static boolean |
equalWithNull(Object obj1,
Object obj2)
Does an equals check by first checking identity, then equality.
|
static void |
fill(List list,
Object[] elements)
Populates a list with an array of elements.
|
static Element |
getImage(ImageResource ir)
Returns an element for the given image.
|
static boolean |
isEmptyString(String string)
Returns true if the string is null or equals to the empty string.
|
static boolean |
isInteger(String value)
Tests if the value is an integer.
|
static int |
parseInt(String value,
int defaultValue)
Parses a string value and returns an integer.
|
static Style.Overflow |
parseOverflow(String value)
Parses a string value and returns the applicable
Style.Overflow object. |
static Element[] |
toElementArray(List<Element> nodes)
Converts a node list to an element array.
|
static Element[] |
toElementArray(NodeList<Element> nodes)
Converts a node list to an element array.
|
public static int constrain(int value,
int min,
int max)
value - the valuemin - the minimummax - the maximumpublic static List createList(Object... element)
element - the item to add to the listpublic static boolean equalWithNull(Object obj1, Object obj2)
obj1 - object 1obj2 - object 2public static void fill(List list, Object[] elements)
list - the listelements - the elements to be added to the listpublic static Element getImage(ImageResource ir)
ir - the image resourcepublic static boolean isEmptyString(String string)
string - the string to testpublic static boolean isInteger(String value)
value - the value to testpublic static int parseInt(String value, int defaultValue)
value - the string valuedefaultValue - the default valuepublic static Style.Overflow parseOverflow(String value)
Style.Overflow object.value - the string valueStyle.Overflow objectpublic static Element[] toElementArray(List<Element> nodes)
nodes - the nodesCopyright © 2012. All Rights Reserved.