Commit cea5ca6a by Michael Koch Committed by Michael Koch

ArrayHelper.java, [...]: Reformatted to match classpath's versions.

2003-06-17  Michael Koch  <konqueror@gmx.de>

	* gnu/java/lang/ArrayHelper.java,
	gnu/java/lang/ClassHelper.java:
	Reformatted to match classpath's versions.

From-SVN: r68078
parent c1e5104d
2003-06-17 Michael Koch <konqueror@gmx.de>
* gnu/java/lang/ArrayHelper.java,
gnu/java/lang/ClassHelper.java:
Reformatted to match classpath's versions.
2003-06-14 Michael Koch <konqueror@gmx.de> 2003-06-14 Michael Koch <konqueror@gmx.de>
* gnu/java/nio/FileChannelImpl.java * gnu/java/nio/FileChannelImpl.java
......
/* gnu.java.lang.ArrayHelper /* ArrayHelper.java -- Helper methods for handling array operations
Copyright (C) 1998 Free Software Foundation, Inc. Copyright (C) 1998, 2002 Free Software Foundation, Inc.
This file is part of GNU Classpath. This file is part of GNU Classpath.
...@@ -39,20 +39,37 @@ exception statement from your version. */ ...@@ -39,20 +39,37 @@ exception statement from your version. */
package gnu.java.lang; package gnu.java.lang;
/** /**
** ArrayHelper helps you do things with arrays. * ArrayHelper helps you do things with arrays.
** *
** @author John Keiser * @author John Keiser
** @version 1.1.0, 29 Jul 1998 */
**/ public class ArrayHelper
{
public class ArrayHelper { /**
public static boolean contains(Object[] array, Object searchFor) { * Counterpart to java.util.Collection.contains.
return indexOf(array,searchFor) != -1; *
* @param array the array to search
* @param searchFor the object to locate
* @return true if some array element <code>equals(searchFor)</code>
*/
public static boolean contains(Object[] array, Object searchFor)
{
return indexOf(array, searchFor) != -1;
} }
public static int indexOf(Object[] array, Object searchFor) { /**
for(int i=0;i<array.length;i++) { * Counterpart to java.util.Collection.indexOf.
if(array[i].equals(searchFor)) { *
* @param array the array to search
* @param searchFor the object to locate
* @return the index of the first equal object, or -1
*/
public static int indexOf(Object[] array, Object searchFor)
{
for (int i = 0; i < array.length; i++)
{
if(array[i].equals(searchFor))
{
return i; return i;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment