Package pfvisualizer.util
Class Utils
- java.lang.Object
-
- pfvisualizer.util.Utils
-
public class Utils extends java.lang.ObjectA static utility class.
-
-
Constructor Summary
Constructors Constructor Description Utils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Node[]arrayCopyOf(Node[] array, int n)Copies the first n elements of a given array to a new array of size n.static int[][]copy2dArray(int width, int height, int[][] array)Copies a given 2d array.static float[][]initialize2dArray(int width, int height, float value)Creates a 2d array initialized with the given value.
-
-
-
Method Detail
-
initialize2dArray
public static float[][] initialize2dArray(int width, int height, float value)Creates a 2d array initialized with the given value.- Parameters:
width- width of the new arrayheight- height of the new arrayvalue- the initial value of all elements- Returns:
- a 2d array initialized with the given value
-
arrayCopyOf
public static Node[] arrayCopyOf(Node[] array, int n)
Copies the first n elements of a given array to a new array of size n.- Parameters:
array- array to copy elements fromn- number of elements to be copied- Returns:
- a new array with n first elements from the given array
-
copy2dArray
public static int[][] copy2dArray(int width, int height, int[][] array)Copies a given 2d array.- Parameters:
width- width of the arrayheight- height of the arrayarray- array to be copied- Returns:
- copy of the given array
-
-