Class VotingSystem

java.lang.Object
VotingSystem

public class VotingSystem
extends java.lang.Object
this class present date present info about all the voting
  • Constructor Summary

    Constructors 
    Constructor Description
    VotingSystem()  
  • Method Summary

    Modifier and Type Method Description
    void creatVoting​(int type, java.lang.String question, java.util.ArrayList<java.lang.String> options)
    creat a new voting by given parameters
    void deleteVoting​(Voting votingToDelete)
    this method delete intended voting
    void printResult​(int index)
    this method print intended voting
    void printVoting​(int index)
    print the given voting number
    void printVotingQuestions()
    this method print all the voting question
    void vote​(int index, Person person, java.util.ArrayList<java.lang.String> choices)
    add a vote with given data in the voting

    Methods inherited from class java.lang.Object

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

  • Method Details

    • creatVoting

      public void creatVoting​(int type, java.lang.String question, java.util.ArrayList<java.lang.String> options)
      creat a new voting by given parameters
      Parameters:
      question - of the voting
      type - of voting
      options - of voting
    • printVotingQuestions

      public void printVotingQuestions()
      this method print all the voting question
    • printVoting

      public void printVoting​(int index)
      print the given voting number
      Parameters:
      index - the voting we want to print its question
    • vote

      public void vote​(int index, Person person, java.util.ArrayList<java.lang.String> choices)
      add a vote with given data in the voting
      Parameters:
      index - of voting
      person - voter
      choices - option to vote for
    • deleteVoting

      public void deleteVoting​(Voting votingToDelete)
      this method delete intended voting
      Parameters:
      votingToDelete - the voting has to be deleted
    • printResult

      public void printResult​(int index)
      this method print intended voting
      Parameters:
      index - the index of intended voting