gvsu/cs656/lab3/StringKey.java
josh fac92be897 moved source files out of src directory
git-svn-id: svn://anubis/gvsu@215 45c1a28c-8058-47b2-ae61-ca45b979098e
2008-10-27 21:18:32 +00:00

39 lines
838 B
Java

/**
* <p>Title: Lab2</p>
* <p>Description: Chord Key for strings </p>
* <p>Copyright: Copyright (c) 2008</p>
* <p>Company: Grand Vally State University</p>
* @author Jonathan Engelsma
* @version 1.0
*/
import de.uniba.wiai.lspi.chord.service.Key;
/**
* Implements a simple Chord Key for Strings. See sample code or OpenChord manual for more details.
*/
public class StringKey implements Key {
String theString ;
public StringKey ( String theString )
{
this.theString = theString ;
}
public byte [] getBytes (){
return this.theString.getBytes();
}
public int hashCode (){
return this.theString.hashCode();
}
public boolean equals ( Object o){
if (o instanceof StringKey )
{
return (( StringKey)o).theString.equals(this.theString );
}
return false;
}
}