public interface VoteCounting<S extends VoteCountingStrategy>
| Modifier and Type | Method and Description |
|---|---|
String |
getDisplayVoteValue(Integer voteValue)
Get the value to display for a given vote value in the vote page.
|
String |
getHelp(Locale locale)
Get the vote counting strategy help to display in UI.
|
int |
getId()
Obtains the unique id of this strategy.
|
String |
getName(Locale locale)
Get the vote counting strategy name to display in UI.
|
String |
getShortHelp(Locale locale)
Get the vote counting short help to display in UI.
|
String |
getTotalVoteValueNotValidMessage(Locale locale)
If the total values of a vote is not valid, gets the localized error
message.
|
ChoiceToVoteRenderType |
getVoteValueEditorType()
Gets the type of editor used to render a vote value.
|
String |
getVoteValueNotValidMessage(Locale locale,
String choiceName,
String voteValue)
If a vote value is not valid, gets the localized message of the error.
|
boolean |
isChoiceInVote(Integer voteValue)
Test if the given value is a vote value (says users has filled it).
|
boolean |
isTotalVoteValueValid(int totalValues)
Tests if the total values of a vote is valid.
|
boolean |
isVoteValueNull(Integer value)
Tests if a given vote value is null or not.
|
boolean |
isVoteValueValid(Integer voteValue)
Tests if the given vote value is valid.
|
S |
newStrategy()
Obtains a fresh instance of a vote coutning strategy.
|
S newStrategy()
int getId()
String getDisplayVoteValue(Integer voteValue)
voteValue - the vote value to displayboolean isChoiceInVote(Integer voteValue)
voteValue - the vote value to testtrue if the given value is persisted.String getName(Locale locale)
locale - the locale used to render the strategy nameString getShortHelp(Locale locale)
locale - the locale used to render the strategy nameString getHelp(Locale locale)
locale - the locale used to render the strategy nameboolean isVoteValueValid(Integer voteValue)
voteValue - the vote value to testtrue if the given vote value is valid, false
otherwise.String getVoteValueNotValidMessage(Locale locale, String choiceName, String voteValue)
locale - the locale used to render the error messagechoiceName - name of thechoicevoteValue - value fo the voteboolean isTotalVoteValueValid(int totalValues)
totalValues - the given total valuestrue if the total values of a vote is valid,
false otherwhise.String getTotalVoteValueNotValidMessage(Locale locale)
locale - the locale used to render the error messageboolean isVoteValueNull(Integer value)
value - the vote value to testtrue if the given vote value is null (or considered as
null), false otherwise.ChoiceToVoteRenderType getVoteValueEditorType()
ChoiceToVoteRenderTypeCopyright © 2009-2012 CodeLutin. All Rights Reserved.