|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.rit.survey.SurveyVote
public class SurveyVote
Class SurveyVote encapsulates the user's vote in a survey.
The survey vote object keeps track of one participant's vote. A timestamp (logical clock value) is associated with the vote as well. Each time the participant changes the vote, the timestamp is incremented. The timestamp is limited to a maximum of 32767.
Constructor Summary | |
---|---|
SurveyVote()
Construct a new survey vote object. |
Method Summary | |
---|---|
boolean |
isVoteFor(int i)
Determine if there is a vote for the given answer. |
void |
read(ObjectInput in)
Read this survey vote from the given object input stream. |
void |
setVoteFor(int i)
Record a vote for the given answer. |
void |
write(ObjectOutput out)
Write this survey vote to the given object output stream. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SurveyVote()
Method Detail |
---|
public boolean isVoteFor(int i)
i
- Answer index (0-3).
public void setVoteFor(int i)
i
- Answer index (0-3).
IllegalStateException
- (unchecked exception) Thrown if the timestamp is at the maximum
(32767).public void write(ObjectOutput out) throws IOException
out
- Object output stream.
IOException
- Thrown if an I/O error occurred.public void read(ObjectInput in) throws IOException
in
- Object input stream.
IOException
- Thrown if an I/O error occurred.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |