|
GWT Tk 0.2.3 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectasquare.gwt.tk.client.util.GwtUtil
public class GwtUtil
General utility methods for working with in GWT.
| Constructor Summary | |
|---|---|
GwtUtil()
|
|
| Method Summary | |
|---|---|
static void |
arrayCopy(Object src,
int srcPos,
Object dest,
int destPos,
int length)
Copies elements from the src array to the dest array. |
static boolean |
equals(String a,
String b)
Tests two Strings for equality. |
static void |
rangeCheck(int first,
int size,
int n,
boolean extend)
Checks that a number is contained within the specified range. |
static void |
rangeCheck(List list,
int index,
boolean adding)
Checks that the specified index is valid for the list (the GWT emulation of Vector does not perform range checking). |
static Object[] |
toArray(List src,
Object[] dest)
Copies all of the elements in list to array. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public GwtUtil()
| Method Detail |
|---|
public static void rangeCheck(List list,
int index,
boolean adding)
throws IndexOutOfBoundsException
Vector does not perform range checking). A
flag is passed to indicate whether the range should be extended by 1 to
allow for adding a last element. Throws an exception if the index is out
of bounds for the list.
list - the list to check againstindex - the index to range checkadding - true to allow for
adding at the index
after last element in list
IndexOutOfBoundsException - if the index is out of range
public static void rangeCheck(int first,
int size,
int n,
boolean extend)
throws IndexOutOfBoundsException
first - the first allowable numbersize - the size of the allowed rangen - the index to range checkextend - true to extend the size of the range by
1
IndexOutOfBoundsException - if the index is out of range
public static void arrayCopy(Object src,
int srcPos,
Object dest,
int destPos,
int length)
src array to the dest array.
src - the source arraysrcPos - the starting position in the source arraydest - the destination arraydestPos - the starting position in the destination arraylength - the number of array elements to copy
NullPointerException - if src or dest is null
IndexOutOfBoundsException - if srcPos < 0 || destPos < 0 || length < 0 || (srcPos + length > src.length) || (destPos + length > dest.length)
ArrayStoreException - if an element in src cannot not be copied to dest due to a type mismatchSystem.arraycopy(Object, int, Object, int, int)
public static Object[] toArray(List src,
Object[] dest)
list to array.
Similar to List.toArray(Object[]) except this does not
automatically expand the array size.
src - a listdest - a non-primitive array
NullPointerException - if src or dest
is null
IndexOutOfBoundsException - if dest is not large
enough to contain all of the list elements.
ArrayStoreException - if an element in list cannot
not be copied to dest due to a type mismatch
public static boolean equals(String a,
String b)
String.equals(Object).
Either argument may be null.
a - a String, or nullb - a String, or null
true if (a == b || a != null && a.equals(b))
|
GWT Tk 0.2.3 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||