2003-08-02 Michael Koch <konqueror@gmx.de>
* gnu/java/lang/ArrayHelper.java (equalsArray): Reformated, added method documentation. From-SVN: r70099
This commit is contained in:
parent
15b68e0201
commit
7575931c17
@ -1,3 +1,8 @@
|
||||
2003-08-02 Michael Koch <konqueror@gmx.de>
|
||||
|
||||
* gnu/java/lang/ArrayHelper.java
|
||||
(equalsArray): Reformated, added method documentation.
|
||||
|
||||
2003-08-02 Michael Koch <konqueror@gmx.de>
|
||||
|
||||
* java/net/URL.java
|
||||
|
@ -76,16 +76,22 @@ public class ArrayHelper
|
||||
return -1;
|
||||
}
|
||||
|
||||
public static boolean equalsArray(Object[] a, Object[] b) {
|
||||
if(a.length == b.length) {
|
||||
for(int i=0;i<a.length;i++) {
|
||||
if(!a[i].equals(b[i])) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Checks if two arrays are equal.
|
||||
*
|
||||
* @param array1 the first array
|
||||
* @param array2 the second array
|
||||
* @return true if both arrays are equal.
|
||||
*/
|
||||
public static boolean equalsArray(Object[] array1, Object[] array2)
|
||||
{
|
||||
if (array1.length != array2.length)
|
||||
return false;
|
||||
|
||||
for (int index = 0; index < array1.length; index++)
|
||||
if (!array1 [index].equals (array2 [index]))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user