1 16 package org.javabb.component; 17 18 import java.util.HashMap ; 19 import java.util.LinkedHashSet ; 20 import java.util.Map ; 21 22 import org.javabb.vo.Topic; 23 24 29 public class Spy { 30 31 private static LinkedHashSet mostViews; 32 private static Map messagesI18n; 33 34 public static LinkedHashSet getSpyTopics() { 35 return Spy.mostViews; 36 } 37 38 public static void addSpyTopic(Topic topic) { 39 if (topic != null) { 40 if(Spy.mostViews == null){ 41 Spy.mostViews = new LinkedHashSet (); 42 } 43 LinkedHashSet set = new LinkedHashSet (); 44 set.add(topic); 45 set.addAll(Spy.mostViews); 46 Spy.mostViews = set; 47 } 48 } 49 50 public static void set18Messages(Map values){ 51 if(Spy.messagesI18n == null){ 52 Spy.messagesI18n = new HashMap (); 53 } 54 Spy.messagesI18n = values; 55 } 56 57 public static Map getI18NMessages() { 58 return Spy.messagesI18n; 59 } 60 61 62 } 63 | Popular Tags |