public class GwtCompatibility extends Object
Constructor and Description |
---|
GwtCompatibility() |
Modifier and Type | Method and Description |
---|---|
static Coord[] |
cloneCoords(Coord[] input)
Gets an exact copy of an array of Coord.
|
static boolean[][] |
copy2D(boolean[][] source)
Gets a copy of the 2D boolean array, source, that has the same data but shares no references with source.
|
static char[][] |
copy2D(char[][] source)
Gets a copy of the 2D char array, source, that has the same data but shares no references with source.
|
static double[][] |
copy2D(double[][] source)
Gets a copy of the 2D double array, source, that has the same data but shares no references with source.
|
static int[][] |
copy2D(int[][] source)
Gets a copy of the 2D int array, source, that has the same data but shares no references with source.
|
static boolean[][] |
fill2D(boolean contents,
int width,
int height)
Creates a 2D array of the given width and height, filled with entirely with the value contents.
|
static char[][] |
fill2D(char contents,
int width,
int height)
Creates a 2D array of the given width and height, filled with entirely with the value contents.
|
static double[][] |
fill2D(double contents,
int width,
int height)
Creates a 2D array of the given width and height, filled with entirely with the value contents.
|
static int[][] |
fill2D(int contents,
int width,
int height)
Creates a 2D array of the given width and height, filled with entirely with the value contents.
|
static <T> T |
first(Iterable<T> collection)
Gets the first item in an Iterable of T, or null if it is empty.
|
static double |
IEEEremainder(double op,
double d)
A replacement for Math.IEEEremainder, just because Math.IEEEremainder isn't GWT-compatible.
|
static boolean[][] |
insert2D(boolean[][] source,
boolean[][] target,
int x,
int y)
Inserts as much of source into target at the given x,y position as target can hold or source can supply.
|
static char[][] |
insert2D(char[][] source,
char[][] target,
int x,
int y)
Inserts as much of source into target at the given x,y position as target can hold or source can supply.
|
static double[][] |
insert2D(double[][] source,
double[][] target,
int x,
int y)
Inserts as much of source into target at the given x,y position as target can hold or source can supply.
|
static int[][] |
insert2D(int[][] source,
int[][] target,
int x,
int y)
Inserts as much of source into target at the given x,y position as target can hold or source can supply.
|
public GwtCompatibility()
public static Coord[] cloneCoords(Coord[] input)
input
- an array of Coord to copyinput
.public static double IEEEremainder(double op, double d)
op
- the operand/dividendd
- the divisorop / d
, as a double; can be negativepublic static <T> T first(Iterable<T> collection)
T
- any object typecollection
- an Iterable of T; if collection is null or empty this returns nullpublic static char[][] copy2D(char[][] source)
source
- a 2D char arraypublic static double[][] copy2D(double[][] source)
source
- a 2D double arraypublic static int[][] copy2D(int[][] source)
source
- a 2D int arraypublic static boolean[][] copy2D(boolean[][] source)
source
- a 2D boolean arraypublic static char[][] insert2D(char[][] source, char[][] target, int x, int y)
source
- a 2D char array that will be copied and inserted into targettarget
- a 2D char array that will be modified by receiving as much of source as it can holdx
- the x position in target to receive the items from the first cell in sourcey
- the y position in target to receive the items from the first cell in sourcepublic static double[][] insert2D(double[][] source, double[][] target, int x, int y)
source
- a 2D double array that will be copied and inserted into targettarget
- a 2D double array that will be modified by receiving as much of source as it can holdx
- the x position in target to receive the items from the first cell in sourcey
- the y position in target to receive the items from the first cell in sourcepublic static int[][] insert2D(int[][] source, int[][] target, int x, int y)
source
- a 2D int array that will be copied and inserted into targettarget
- a 2D int array that will be modified by receiving as much of source as it can holdx
- the x position in target to receive the items from the first cell in sourcey
- the y position in target to receive the items from the first cell in sourcepublic static boolean[][] insert2D(boolean[][] source, boolean[][] target, int x, int y)
source
- a 2D boolean array that will be copied and inserted into targettarget
- a 2D boolean array that will be modified by receiving as much of source as it can holdx
- the x position in target to receive the items from the first cell in sourcey
- the y position in target to receive the items from the first cell in sourcepublic static char[][] fill2D(char contents, int width, int height)
contents
- the value to fill the array withwidth
- the desired widthheight
- the desired heightpublic static double[][] fill2D(double contents, int width, int height)
contents
- the value to fill the array withwidth
- the desired widthheight
- the desired heightpublic static int[][] fill2D(int contents, int width, int height)
contents
- the value to fill the array withwidth
- the desired widthheight
- the desired heightpublic static boolean[][] fill2D(boolean contents, int width, int height)
contents
- the value to fill the array withwidth
- the desired widthheight
- the desired heightCopyright © 2012–2016. All rights reserved.