public class CSPollContentAnswer
extends java.lang.Object
implements java.io.Serializable
An answer comprises a tag identifier e.g. "A", a value which is the actual answer e.g. "London", and the number of votes cast for it.
The getAnswers
method provided within CSPoll
will return an
ArrayList
of these objects. Likewise, the setAnswers
method
expects an ArrayList
of these objects as input.
Constructor and Description |
---|
CSPollContentAnswer()
Creates an empty
CSPollContentAnswer object. |
CSPollContentAnswer(java.lang.String strTag,
java.lang.String strValue,
int nVotes)
Creates a
CSPollContentAnswer object and populates it with the supplied tag, value and vote
information. |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone()
Creates a duplicate of this
CSPollContentAnswer object. |
boolean |
equals(java.lang.Object obj)
Determines whether the data contained in this
CSPollContentAnswer object is the same as that
contained within the one supplied. |
java.lang.String |
getTag()
Gets the answer's tag identifier.
|
java.lang.String |
getValue()
Gets the answer's text.
|
int |
getVotes()
Gets the number of votes cast for this answer.
|
void |
setTag(java.lang.String strTag)
Sets the answer's tag identifier.
|
void |
setValue(java.lang.String strValue)
Sets the actual answer text.
|
void |
setVotes(int nVotes)
Sets the number of votes cast for this answer.
|
java.lang.String |
toString()
Outputs the contents of this
CSPollContentAnswer object to a String object in a
user-friendly format. |
public CSPollContentAnswer()
CSPollContentAnswer
object.public CSPollContentAnswer(java.lang.String strTag, java.lang.String strValue, int nVotes)
CSPollContentAnswer
object and populates it with the supplied tag, value and vote
information.strTag
- The tag identifier of the answer.strValue
- The answer text.nVotes
- The total number of votes.public void setTag(java.lang.String strTag)
strTag
- the tag identifier of the answerpublic java.lang.String getTag()
public void setValue(java.lang.String strValue)
strValue
- the answer textpublic java.lang.String getValue()
public void setVotes(int nVotes)
nVotes
- the number of votes castpublic int getVotes()
public java.lang.String toString()
CSPollContentAnswer
object to a String
object in a
user-friendly format.
toString
in class java.lang.Object
String
containing the user-friendly outputpublic boolean equals(java.lang.Object obj)
CSPollContentAnswer
object is the same as that
contained within the one supplied. Note that the key data used for searching is not tested for equality.
equals
in class java.lang.Object
obj
- The CSPollContentAnswer
to be tested for equalitytrue
if the data matches, false
otherwise.public java.lang.Object clone() throws java.lang.OutOfMemoryError
CSPollContentAnswer
object.
clone
in class java.lang.Object
CSPollContentAnswer
objectjava.lang.OutOfMemoryError
- Thrown if there are any problems allocating memoryCopyright © 2022 Goss Interactive Ltd. All Rights Reserved.