Class Voting

java.lang.Object
Voting

public class Voting
extends java.lang.Object
this class give info about a voting
  • Constructor Summary

    Constructors 
    Constructor Description
    Voting​(int type, java.lang.String question, java.util.ArrayList<java.lang.String> choices)
    creat a new voting
  • Method Summary

    Modifier and Type Method Description
    void createChoice​(java.lang.String choice)
    add a new option to voting
    java.util.ArrayList<java.lang.String> getChoices()
    get the option list
    java.lang.String getQuestion()
    get the question
    int getType()
    this method return type of voting
    void getVoters()
    this method goes through voters and print a list of them
    void printVotes()  
    void vote​(Person person, java.util.ArrayList<java.lang.String> choices)
    add a new vote to voting by given person and choices

    Methods inherited from class java.lang.Object

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

    • Voting

      public Voting​(int type, java.lang.String question, java.util.ArrayList<java.lang.String> choices)
      creat a new voting
      Parameters:
      type - of voting
      question - question of voting
      choices - list of options
  • Method Details

    • getType

      public int getType()
      this method return type of voting
      Returns:
      type
    • getChoices

      public java.util.ArrayList<java.lang.String> getChoices()
      get the option list
      Returns:
      choices
    • getQuestion

      public java.lang.String getQuestion()
      get the question
      Returns:
      question
    • createChoice

      public void createChoice​(java.lang.String choice)
      add a new option to voting
      Parameters:
      choice - we want to add
    • vote

      public void vote​(Person person, java.util.ArrayList<java.lang.String> choices)
      add a new vote to voting by given person and choices
      Parameters:
      person - who voted
      choices - were voted
    • getVoters

      public void getVoters()
      this method goes through voters and print a list of them
    • printVotes

      public void printVotes()