Created
April 25, 2013 00:41
-
-
Save anonymous/5456717 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package Roulette; | |
import java.text.MessageFormat; | |
public class Outcome<E> implements Comparable<E> { | |
private String name; | |
private int odds; | |
public Outcome(String name, int odds){ | |
this.name = name; | |
this.odds = odds; | |
} | |
public int winAmount(int amount){ | |
return amount*this.odds; | |
} | |
public boolean equals(Outcome other){ | |
return (this.name.equals(other.name)); | |
} | |
public String toString() { | |
Object[] values= { name, new Integer(odds) }; | |
String msgTempl= "{0} ({1}:1)"; | |
return MessageFormat.format( msgTempl, values ); | |
} | |
@Override | |
public int compareTo(E arg0) { | |
// TODO Auto-generated method stub | |
return 0; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment