Class Vote

java.lang.Object
Vote

public class Vote
extends java.lang.Object
this class save data about a vote
  • Constructor Summary

    Constructors 
    Constructor Description
    Vote()
    creat a new vote
    Vote​(Person person, java.lang.String date)
    creat a new vote with given data
  • Method Summary

    Modifier and Type Method Description
    boolean equals​(java.lang.Object o)
    this method compare the current object with given object
    java.lang.String getDate()
    return date of vote
    Person getPerson()
    return the voter
    int hashCode()
    this method set hashcode for each vote

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Vote

      public Vote​(Person person, java.lang.String date)
      creat a new vote with given data
      Parameters:
      person - voter
      date - date of vote in shamsi
    • Vote

      public Vote()
      creat a new vote
  • Method Details

    • getPerson

      public Person getPerson()
      return the voter
      Returns:
      person
    • getDate

      public java.lang.String getDate()
      return date of vote
      Returns:
      date
    • equals

      public boolean equals​(java.lang.Object o)
      this method compare the current object with given object
      Overrides:
      equals in class java.lang.Object
      Parameters:
      o - given object
      Returns:
      boolean
    • hashCode

      public int hashCode()
      this method set hashcode for each vote
      Overrides:
      hashCode in class java.lang.Object
      Returns:
      Objects.hash(person, date)