Update of /var/cvs/contributions/CMSContainer_Portlets/portlets-newsletter/src/java/com/finalist/newsletter/publisher/cache In directory james.mmbase.org:/tmp/cvs-serv19091
Modified Files: DefaultCache.java Log Message: CMSC-899,Check and improve all lists according to guideline,add Javadoc comment See also: http://cvs.mmbase.org/viewcvs/contributions/CMSContainer_Portlets/portlets-newsletter/src/java/com/finalist/newsletter/publisher/cache See also: http://www.mmbase.org/jira/browse/CMSC-899 Index: DefaultCache.java =================================================================== RCS file: /var/cvs/contributions/CMSContainer_Portlets/portlets-newsletter/src/java/com/finalist/newsletter/publisher/cache/DefaultCache.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -b -r1.3 -r1.4 --- DefaultCache.java 22 Sep 2008 08:28:51 -0000 1.3 +++ DefaultCache.java 22 Sep 2008 08:35:26 -0000 1.4 @@ -1,13 +1,13 @@ package com.finalist.newsletter.publisher.cache; - - import java.util.Collections; import java.util.HashMap; import java.util.Map; import java.util.Timer; import java.util.TimerTask; - +/** + * @author nikko yin + */ public class DefaultCache implements ICache{ private static final int FreshTimerIntervalSeconds = 1; @@ -30,23 +30,35 @@ this(); this.time=time; } - + /** + * add + * @param bean and value + */ public void add(Object key, Object value) { add(key, value,time); } - + /** + * add + * @param bean , value and slidingExpiration + */ public void add(Object key, Object value, long slidingExpiration) { if(slidingExpiration!=0){ CacheInfo ci=new CacheInfo(value, slidingExpiration); datas.put((String) key, ci); } } - + /** + * contains + * @param key + */ public boolean contains(Object key) { if(datas.containsKey(key))return true; return false; } - + /** + * get + * @param key + */ public Object get(Object key) { if(datas.containsKey(key)){ CacheInfo ci=datas.get(key); @@ -56,22 +68,37 @@ } return null; } - + /** + * remove + * @param key + */ public void remove(Object key) { datas.remove(key); } - + /** + * removeAll + * @param null + */ public void removeAll() { } - + /** + * getTime + * @param null + */ public long getTime() { return time; } - + /** + * setTime + * @param time + */ public void setTime(long time) { this.time = time; } - + /** + * getDatas + * @param null + */ public Map<String, CacheInfo> getDatas() { return datas; } _______________________________________________ Cvs mailing list Cvs@lists.mmbase.org http://lists.mmbase.org/mailman/listinfo/cvs