org.exoplatform.poll.service
Class Utils

java.lang.Object
  extended by org.exoplatform.poll.service.Utils

public class Utils
extends Object

Created by The eXo Platform SAS Author : Vu Duy Tu tu.duy@exoplatform.com Apr 28, 2011


Field Summary
static String COLON
           
 
Constructor Summary
Utils()
           
 
Method Summary
static Poll calculateVote(Poll poll, String userId, String voteOptions)
          Calculate data of poll when user Voted.
static Calendar getGreenwichMeanTime()
           
static boolean isEmpty(String s)
           
static boolean isListEmpty(List<String> list)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COLON

public static final String COLON
Constructor Detail

Utils

public Utils()
Method Detail

getGreenwichMeanTime

public static Calendar getGreenwichMeanTime()

isEmpty

public static boolean isEmpty(String s)

isListEmpty

public static boolean isListEmpty(List<String> list)

calculateVote

public static Poll calculateVote(Poll poll,
                                 String userId,
                                 String voteOptions)
                          throws Exception
Calculate data of poll when user Voted. Apply for all case (Single vote and multi vote)

Parameters:
poll - the poll after user vote.
userId - the user name voted.
voteOptions - the value user voted. - If is single vote, the value is one number. - If is multi vote, the value has format a:b:c, with a,b,c is number user selected.
Throws:
Exception - the exception


Copyright © 2013 eXo Platform SAS. All Rights Reserved.