|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Poll
A Poll object manages the data and processes for all of the public and private voting polls available through the CoffeeMud POLL CREATE POLL, LIST POLLS, etc.. commands. These objects are managed by the PollManager Library
PollManager
,
CMLib.polls()
Nested Class Summary | |
---|---|
static class |
Poll.PollOption
A class to represent a single choosable option for this poll. |
static class |
Poll.PollResult
A class to represent a single vote by a single user in this poll. |
Field Summary | |
---|---|
static int |
FLAG_ABSTAIN
bitmask poll flag denoting that players may select to abstain from a vote |
static int |
FLAG_ACTIVE
bitmask poll flag denoting that the poll is ready to receive votes |
static int |
FLAG_HIDERESULTS
bitmask poll flag denoting that players may never seen the results of the poll |
static int |
FLAG_NOTATLOGIN
bitmask poll flag denoting that players will not be given a chance to vote at logon |
static int |
FLAG_PREVIEWRESULTS
bitmask poll flag denoting that players may preview results before voting |
static int |
FLAG_VOTEBYIP
bitmask poll flag denoting that a player is considered to have voted if ips match |
Method Summary | |
---|---|
void |
addVoteResult(Poll.PollResult R)
Populates this Poll object if necessary, and adds the given PollResult object that represents a mobs vote in this Poll to the list of results. |
java.lang.String |
getAuthor()
Returns the Name of the creator of this poll. |
java.lang.String |
getDescription()
Returns the description shown when participating in the poll. |
long |
getExpiration()
Returns the time, in millis since 1970, that this poll expires. |
long |
getFlags()
Returns a bitmap of flags related to this poll. |
Poll.PollResult |
getMyVote(MOB mob)
Populates this Poll object if necessary, and returns the PollResult object that represents the given mobs vote in this Poll, or NULL otherwise. |
java.lang.String |
getName()
A name for this poll, used for internal purposes only. |
java.util.List<Poll.PollOption> |
getOptions()
Returns a list of PollOption objects denoting the poll choices. |
java.lang.String |
getOptionsXML()
Returns a String of PollOption objects rendered as an XML document. |
java.lang.String |
getQualZapper()
Returns a zapper mask string to mask out valid participants. |
java.util.List<Poll.PollResult> |
getResults()
Returns a list of PollResult objects renoting all poll votes. |
java.lang.String |
getResultsXML()
Returns a String of PollResult objects rendered as an XML document. |
java.lang.String |
getSubject()
Returns the title used when showing poll results. |
boolean |
loaded()
Returns whether the PollOption and PollResult objects have already been loaded and populated into this object from the database. |
boolean |
mayISeeResults(MOB mob)
Returns true if the given mob may not see the poll results, false otherwise. |
boolean |
mayIVote(MOB mob)
Returns true if the given mob is allowed to vote in this poll, false otherwise. |
void |
setAuthor(java.lang.String newname)
Sets the Name of the creator of this poll. |
void |
setDescription(java.lang.String newdescription)
Sets the description shown when participating in the poll. |
void |
setExpiration(long time)
Sets the time, in millis since 1970, that this poll expires. |
void |
setFlags(long flag)
Sets a bitmap of flags related to this poll. |
void |
setLoaded(boolean truefalse)
Sets whether the PollOption and PollResult objects have already been loaded and populated into this object from the database. |
void |
setName(java.lang.String newname)
Sets a name for this poll, used for internal purposes only. |
void |
setOptions(java.util.List<Poll.PollOption> V)
Sets a list of PollOption objects denoting the poll choices. |
void |
setQualZapper(java.lang.String newZap)
Sets a zapper mask string to mask out valid participants. |
void |
setResults(java.util.List<Poll.PollResult> V)
Sets a list of PollResult objects renoting all poll votes. |
void |
setSubject(java.lang.String newsubject)
Sets the title used when showing poll results. |
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.CMObject |
---|
copyOf, ID, initializeClass, name, newInstance |
Methods inherited from interface java.lang.Comparable |
---|
compareTo |
Field Detail |
---|
static final int FLAG_ACTIVE
static final int FLAG_PREVIEWRESULTS
static final int FLAG_ABSTAIN
static final int FLAG_VOTEBYIP
static final int FLAG_HIDERESULTS
static final int FLAG_NOTATLOGIN
Method Detail |
---|
java.lang.String getName()
setName(String)
void setName(java.lang.String newname)
newname
- a name for this pollgetName()
java.lang.String getSubject()
setSubject(String)
void setSubject(java.lang.String newsubject)
newsubject
- the title used when showing poll results.getSubject()
java.lang.String getDescription()
setDescription(String)
void setDescription(java.lang.String newdescription)
newdescription
- the description shown when participating in the poll.getDescription()
java.lang.String getAuthor()
setAuthor(String)
void setAuthor(java.lang.String newname)
newname
- the Name of the creator of this poll.getAuthor()
long getFlags()
setFlags(long)
,
FLAG_ABSTAIN
,
FLAG_ACTIVE
void setFlags(long flag)
flag
- a bitmap of flags related to this poll.getFlags()
,
FLAG_ABSTAIN
,
FLAG_ACTIVE
java.lang.String getQualZapper()
setQualZapper(String)
,
MaskingLibrary.maskCheck(String, Environmental, boolean)
void setQualZapper(java.lang.String newZap)
newZap
- a zapper mask string to mask out valid participants.getQualZapper()
,
MaskingLibrary.maskCheck(String, Environmental, boolean)
long getExpiration()
setExpiration(long)
void setExpiration(long time)
time
- the time, in millis since 1970, that this poll expires.getExpiration()
java.util.List<Poll.PollOption> getOptions()
setOptions(List)
,
Poll.PollOption
void setOptions(java.util.List<Poll.PollOption> V)
V
- a list of PollOption objects denoting the poll choices.getOptions()
,
Poll.PollOption
java.util.List<Poll.PollResult> getResults()
getResults()
,
Poll.PollResult
void setResults(java.util.List<Poll.PollResult> V)
V
- a list of PollResult objects renoting all poll votes.getResults()
,
Poll.PollResult
java.lang.String getOptionsXML()
getOptions()
,
Poll.PollOption
,
PollManager.loadPollIfNecessary(Poll)
java.lang.String getResultsXML()
getResults()
,
Poll.PollResult
,
PollManager.loadPollIfNecessary(Poll)
boolean loaded()
setLoaded(boolean)
,
PollManager.loadPollIfNecessary(Poll)
void setLoaded(boolean truefalse)
truefalse
- set to true if this object is fully populated from the databaseloaded()
,
PollManager.loadPollIfNecessary(Poll)
Poll.PollResult getMyVote(MOB mob)
mob
- the mob to find a result object for
PollManager.loadPollIfNecessary(Poll)
,
addVoteResult(com.planet_ink.coffee_mud.Common.interfaces.Poll.PollResult)
,
Poll.PollResult
void addVoteResult(Poll.PollResult R)
R
- the particular vote by a particular mob to addPollManager.loadPollIfNecessary(Poll)
,
getMyVote(MOB)
,
Poll.PollResult
boolean mayIVote(MOB mob)
mob
- the mob to check for elligibility
getMyVote(MOB)
,
FLAG_VOTEBYIP
,
FLAG_ACTIVE
boolean mayISeeResults(MOB mob)
mob
- the mob to check for elligibility
FLAG_HIDERESULTS
,
FLAG_PREVIEWRESULTS
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |