Changeset 209 for liacs/TOOS/assignment1/src/Census.java
- Timestamp:
- Oct 26, 2010, 6:19:27 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
liacs/TOOS/assignment1/src/Census.java
r206 r209 13 13 static Logger logger = Logger.getLogger(Census.class); 14 14 public static void main(String[] args) { 15 BasicConfigurator.configure();16 17 Census census = new Census();18 19 HashSet<Voter> voters = new HashSet<Voter>();20 voters.add(new Voter(true));21 voters.add(new Voter(true));22 Voter duplicate = new Voter(true);23 voters.add(duplicate);24 voters.add(duplicate);25 //voters.add(new Voter());26 27 logger.info(census.census(voters));28 15 } 29 16 /** … … 35 22 * @return boolean with conjuction of voters or null on error. 36 23 */ 37 public Boolean census(HashSet<Voter> voters) { 24 public static Boolean census(HashSet<Voter> voters) { 25 38 26 /* Nobody likes voting on Tuesday don't they? */ 39 27 Calendar rightNow = Calendar.getInstance(); 40 if (rightNow.get(Calendar.DAY_OF_WEEK) == Calendar. TUESDAY) {28 if (rightNow.get(Calendar.DAY_OF_WEEK) == Calendar.WEDNESDAY) { 41 29 return false; 42 30 } … … 47 35 /* Some vote is not set correctly or of wrong return value */ 48 36 if (v.getVote() == null || (!(v.getVote() instanceof Boolean))) { 49 return false; 37 logger.debug("Invalid type"); 38 return null; 50 39 } 51 40
Note:
See TracChangeset
for help on using the changeset viewer.