glassfrog.players
Class HandRankComparator

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

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

The HandRankComparator is used to rank the players based on their current hand rank, set by the dealer evaluation of thier hands at showdown. The higher the hand rank, the better the hand. Folds are given a rank of -1

Author:
jdavidso

Constructor Summary
HandRankComparator()
           
 
Method Summary
 int compare(Player o1, Player o2)
          Used to sort players by hand rank, The higher the rank, the better the hand
 
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

HandRankComparator

public HandRankComparator()
Method Detail

compare

public int compare(Player o1,
                   Player o2)
Used to sort players by hand rank, The higher the rank, the better the hand

Specified by:
compare in interface java.util.Comparator<Player>
Parameters:
o1 - Player 1
o2 - Player 2
Returns:
0 for a tie, Positive if Player 2 has a higher rank and Negative if Player 1 has a higher rank.