nl.tudelft.goal.ut2004.visualizer.util
Class Score

Package class diagram package Score
java.lang.Object
  extended by nl.tudelft.goal.ut2004.visualizer.util.Score
All Implemented Interfaces:
Comparable<Score>

public class Score
extends Object
implements Comparable<Score>

Utility object that allows scores from players to be sorted in descending order.

Author:
Lennard de Rijk

Constructor Summary
Score(int id, double score)
           
 
Method Summary
 int compareTo(Score o)
           Default order is descending.
 int getId()
           
static ArrayList<Score> getOrderedScoresFor(HashMap<Integer,Double> scoreMap)
          Returns an ordered lists of Score objects that is constructed from the given HashMap.
 double getScore()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Score

public Score(int id,
             double score)
Method Detail

compareTo

public int compareTo(Score o)
Default order is descending.

Specified by:
compareTo in interface Comparable<Score>

getId

public int getId()
Returns:
the ID from the player who has this score

getScore

public double getScore()
Returns:
the score

getOrderedScoresFor

public static ArrayList<Score> getOrderedScoresFor(HashMap<Integer,Double> scoreMap)
Returns an ordered lists of Score objects that is constructed from the given HashMap.

Parameters:
scoreMap - The HashMap that maps UnrealIDs to a score
Returns:
An ArrayList of Score in descending order


Copyright © 2013 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.