View Javadoc
1 /* 2 * PlayerStatsAdapter.java 3 * 4 * Created on April 24, 2003, 12:30 AM 5 */ 6 7 package com.mlw.fps.model.business.dao.memmory.vlh; 8 9 import java.util.ArrayList; 10 import java.util.Iterator; 11 import java.util.List; 12 13 import com.mlw.fps.model.business.dao.memmory.StaticData; 14 import com.mlw.fps.model.business.vo.Game; 15 import com.mlw.fps.model.business.vo.stats.GameStats; 16 import com.mlw.vlh.ValueList; 17 import com.mlw.vlh.ValueListAdapter; 18 import com.mlw.vlh.ValueListInfo; 19 import com.mlw.vlh.impl.DefaultValueList; 20 /*** 21 * 22 * @author Matthew Wilson 23 */ 24 public class GameListAdapter implements ValueListAdapter 25 { 26 27 /*** Creates a new instance of PlayerStatsAdapter */ 28 public GameListAdapter() 29 { 30 } 31 32 /*** This method tells the Service what still needs to be done on the 33 * Collection before returning the data. 34 * 35 * @return A bitwise or combination of DO_NOTHING, 36 * DO_SORT, DO_PAGE and DO_FILTER. For example:<br> 37 * <pre> 38 * public int getAdapterType(){ 39 * retuyrnDO_SORT && DO_PAGE; 40 * }</pre> 41 */ 42 public int getAdapterType() 43 { 44 return DO_SORT; 45 } 46 47 /*** Gets a ValueList 48 * @param info The <CODE>ValueList</CODE> information 49 * @param name The name of the <CODE>ValueList</CODE> 50 * @return The <CODE>ValueList</CODE> 51 */ 52 public ValueList getValueList(ValueListInfo info) 53 { 54 List list= new ArrayList(); 55 56 for (Iterator iter= StaticData.instance().getGames(info.getFilters()).iterator(); iter.hasNext();) 57 { 58 Game game= (Game)iter.next(); 59 //TODO: this is to hide a bug in the half-life loader. 60 if( game.getKills().size() > 0) 61 { 62 list.add( new GameStats(game.getPk(), game.getDate(), game.getMap()) ); 63 } 64 } 65 66 return new DefaultValueList(list, info); 67 } 68 69 }

This page was automatically generated by Maven