Class Searcher

java.lang.Object
  |
  +--Searcher

public class Searcher
extends java.lang.Object

Simple linear searcher.


Constructor Summary
Searcher(java.lang.String[] in)
          Create and populate a list using Strings provided by the caller.
 
Method Summary
 int findName(java.lang.String str)
          Find a name and return its index
static void main(java.lang.String[] arg)
          Run it and find the name supplied by the user.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Searcher

public Searcher(java.lang.String[] in)
Create and populate a list using Strings provided by the caller.

Parameters:
in - the String array to use for initialization
Method Detail

findName

public int findName(java.lang.String str)
Find a name and return its index

Parameters:
str - the name to find
Returns:
the index it's at or -1 if not found

main

public static void main(java.lang.String[] arg)
Run it and find the name supplied by the user.

Parameters:
arg - the name to find in the list