public class PollLib
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private SQLConnector |
sqlConnector |
Constructor and Description |
---|
PollLib() |
Modifier and Type | Method and Description |
---|---|
void |
addPoll(int groupID,
java.lang.String pollDescription,
java.sql.Date pollExpires)
There is no pollID attribute, because it's the tables primary key
This Method adds a poll to the pollData table in the DB
|
void |
addVote(int pollID,
int userID,
int vote)
The boolean in Java is a bit, that's why
TODO Check if the poll even exists
|
Poll |
getPollByID(int pollID) |
int[] |
getPollIDs() |
java.util.LinkedList<Poll> |
getPollsOfGroup(Group g) |
int[][] |
getVotesByID(int pollID) |
void |
insertChanges(Poll p,
Group g) |
private SQLConnector sqlConnector
public int[] getPollIDs()
public void addPoll(int groupID, java.lang.String pollDescription, java.sql.Date pollExpires)
groupID
- the group the poll is assigned topollDescription
- the name of the pollpollExpires
- the date and time the poll expirespublic void addVote(int pollID, int userID, int vote)
pollID
- the poll you are voting foruserID
- the user that votedvote
- your votepublic Poll getPollByID(int pollID)
public int[][] getVotesByID(int pollID)