glassfrog.players
Class PotCommitedComparator

java.lang.Object
  extended by glassfrog.players.PotCommitedComparator
All Implemented Interfaces:
java.util.Comparator<Player>

public class PotCommitedComparator
extends java.lang.Object
implements java.util.Comparator<Player>

The PotCommitedComparator is used to get the least amout a player in a showdown commited to the pot. This allows us to calculate sidepots and pay winners in an iterative fashion.

Author:
jdavidso

Constructor Summary
PotCommitedComparator()
           
 
Method Summary
 int compare(Player o1, Player o2)
          Used to sort players by thier total commited to pot, lowest to highest
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Constructor Detail

PotCommitedComparator

public PotCommitedComparator()
Method Detail

compare

public int compare(Player o1,
                   Player o2)
Used to sort players by thier total commited to pot, lowest to highest

Specified by:
compare in interface java.util.Comparator<Player>
Parameters:
o1 - Player 1
o2 - Player 2
Returns:
0 if Player 1 equals Player 2, Positive if Player 1 commited more than player 2 and Negative if Player 1 commited less