de.rwth.utils
Class ArrayTools
java.lang.Object
|
+--de.rwth.utils.ArrayTools
- public class ArrayTools
- extends java.lang.Object
A collection of useful methods for arrays.
- Version:
- $Id: ArrayTools.java,v 1.2 2002/09/17 06:53:53 mohnen Exp $
- Author:
- Markus Mohnen
Method Summary |
static java.lang.Object[] |
fill(java.lang.Object[] a,
java.lang.Object v)
Fills an array and returns the array. |
static void |
main(java.lang.String[] args)
Mini test environment. |
static int[] |
minus(int[] a,
int[] b)
Creates a new array with those elements which are in the array a ,
but not in the array b . |
static void |
printArray(int[] a)
Prints an array on System.out . |
static int[] |
union(int[] a,
int[] b)
Creates a new array with those elements which are either in the array
a or the array b . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ArrayTools
public ArrayTools()
fill
public static java.lang.Object[] fill(java.lang.Object[] a,
java.lang.Object v)
- Fills an array and returns the array.
- Parameters:
a
- an Object[]
valuev
- an Object
value- Returns:
- an
Object[]
value - See Also:
Arrays.fill(Object[],Object)
minus
public static int[] minus(int[] a,
int[] b)
- Creates a new array with those elements which are in the array
a
,
but not in the array b
.
- Parameters:
a
- an int[]
valueb
- an int[]
value- Returns:
- an
int[]
value
union
public static int[] union(int[] a,
int[] b)
- Creates a new array with those elements which are either in the array
a
or the array b
.
- Parameters:
a
- an int[]
valueb
- an int[]
value- Returns:
- an
int[]
value
printArray
public static void printArray(int[] a)
- Prints an array on
System.out
.
- Parameters:
a
- an int[]
value
main
public static void main(java.lang.String[] args)
- Mini test environment.
- Parameters:
args
- a String[]
value