Class HighscoreEntry

  • All Implemented Interfaces:
    java.lang.Comparable<HighscoreEntry>

    public class HighscoreEntry
    extends java.lang.Object
    implements java.lang.Comparable<HighscoreEntry>
    Store a single highscore entry.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected int boardsize
      The board size.
      protected java.util.Date date
      The date.
      protected int hint_count
      The number of hints used.
      protected java.lang.String name
      The name of the player.
    • Constructor Summary

      Constructors 
      Constructor Description
      HighscoreEntry()
      Create an empty highscore entry.
      HighscoreEntry​(java.lang.String name, int boardsize, int hint_count)
      Create a new highscore entry.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int compareTo​(HighscoreEntry entry)
      Compare two highscore entries.
      boolean equals​(java.lang.Object o)
      Test for equality.
      int getBoardSize()
      Get the boardsize of this HighscoreEntry.
      java.util.Date getDate()
      Get the date of this HighscoreEntry.
      int getHintCount()
      Get the hint_count of this HighscoreEntry.
      java.lang.String getName()
      Get the name of this HighscoreEntry.
      int hashCode()
      Generate a hashcode for this entry.
      void setBoardSize​(int boardsize)
      Set the boardsize of this HighscoreEntry.
      void setDate​(java.util.Date date)
      Set the date of this HighscoreEntry.
      void setHintCount​(int hint_count)
      Set the hint_count of this HighscoreEntry.
      void setName​(java.lang.String name)
      Set the name of this HighscoreEntry.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • date

        protected java.util.Date date
        The date.
      • name

        protected java.lang.String name
        The name of the player.
      • boardsize

        protected int boardsize
        The board size.
      • hint_count

        protected int hint_count
        The number of hints used.
    • Constructor Detail

      • HighscoreEntry

        public HighscoreEntry()
        Create an empty highscore entry.
      • HighscoreEntry

        public HighscoreEntry​(java.lang.String name,
                              int boardsize,
                              int hint_count)
        Create a new highscore entry.
    • Method Detail

      • getName

        public java.lang.String getName()
        Get the name of this HighscoreEntry.
        Returns:
        Returns the name.
      • setName

        public void setName​(java.lang.String name)
        Set the name of this HighscoreEntry.
        Parameters:
        name - The name to set.
      • getBoardSize

        public int getBoardSize()
        Get the boardsize of this HighscoreEntry.
        Returns:
        Returns the boardsize.
      • setBoardSize

        public void setBoardSize​(int boardsize)
        Set the boardsize of this HighscoreEntry.
        Parameters:
        boardsize - The boardsize to set.
      • getHintCount

        public int getHintCount()
        Get the hint_count of this HighscoreEntry.
        Returns:
        Returns the hint_count.
      • setHintCount

        public void setHintCount​(int hint_count)
        Set the hint_count of this HighscoreEntry.
        Parameters:
        hint_count - The hint_count to set.
      • getDate

        public java.util.Date getDate()
        Get the date of this HighscoreEntry.
        Returns:
        Returns the date.
      • setDate

        public void setDate​(java.util.Date date)
        Set the date of this HighscoreEntry.
        Parameters:
        date - The date to set.
      • compareTo

        public int compareTo​(HighscoreEntry entry)
        Compare two highscore entries.
        Specified by:
        compareTo in interface java.lang.Comparable<HighscoreEntry>
      • hashCode

        public int hashCode()
        Generate a hashcode for this entry.
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object o)
        Test for equality.
        Overrides:
        equals in class java.lang.Object