game.Score.Entry Class Reference

A subclass that represents an entry in the HighScore table. More...

List of all members.

Public Member Functions

 Entry (String name, int points)
 The constructor of an entry simply assigns the local Variables.
int compareTo (Object o)
 Compares itself with the given Entry.

Package Attributes

String name
int points


Detailed Description

A subclass that represents an entry in the HighScore table.

Author:
Team Solid Sun

Constructor & Destructor Documentation

game.Score.Entry.Entry ( String  name,
int  points 
)

The constructor of an entry simply assigns the local Variables.

Parameters:
name The name of a player.
points The highScore of the player
00112                                                       {
00113                         this.points = points;
00114                         this.name = name;
00115                 }


Member Function Documentation

int game.Score.Entry.compareTo ( Object  o  ) 

Compares itself with the given Entry.

Parameters:
o An instance of Entry else it will post a Warning to the console.
Returns:
the difference of the actual points and the arguments points
See also:
java.lang.Comparable.compareTo(java.lang.Object)

References game.Score.Entry.points.

Referenced by game.Score.EntryComparator.compare().

00126                                                {
00127                         if (o instanceof Entry) {
00128                                 Entry entry = (Entry) o;
00129                                 return (points - entry.points);
00130                         }
00131                         System.out.println("compare error: " + this.getClass());
00132                         return 0;
00133                 }


Member Data Documentation

String game.Score.Entry.name [package]

int game.Score.Entry.points [package]


The documentation for this class was generated from the following file:

Generated on Mon Jul 28 19:03:06 2008 for SolidJavaTetris by  doxygen 1.5.5