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
-
public Vote(
Person person,
java.lang.String date)
creat a new vote with given data
- Parameters:
person
- voter
date
- date of vote in shamsi
-
public Vote()
creat a new vote
-
Method Details
-
return the voter
- Returns:
- person
-
public java.lang.String getDate()
return date of vote
- Returns:
- date
-
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
-
public int hashCode()
this method set hashcode for each vote
- Overrides:
hashCode
in class java.lang.Object
- Returns:
- Objects.hash(person, date)