View Javadoc
1 /* 2 * PlayerDAOImpl.java 3 * 4 * Created on February 11, 2003, 10:36 AM 5 */ 6 7 package com.mlw.fps.model.business.dao.memmory; 8 9 import java.util.Collection; 10 11 import com.mlw.fps.model.business.dao.PlayerDAO; 12 import com.mlw.fps.model.business.vo.Player; 13 /*** 14 * 15 * @author Matthew Wilson 16 */ 17 public class PlayerDAOImpl implements PlayerDAO 18 { 19 20 /*** Creates a new instance of PlayerDAOImpl 21 */ 22 public PlayerDAOImpl() 23 { 24 } 25 26 public Player getPlayerByPk(String playerPk) 27 { 28 return (Player)StaticData.instance().getPlayers().get(playerPk); 29 } 30 31 public Collection getPlayers() 32 { 33 return StaticData.instance().getPlayersByName().values(); 34 } 35 36 public Player getPlayerByName(String name) 37 { 38 return (Player)StaticData.instance().getPlayersByName().get(name); 39 } 40 41 public void insert(Player player) 42 { 43 if( player.getPk()==null) player.setPk(StaticData.instance().next()); 44 StaticData.instance().getPlayers().put(player.getPk(),player); 45 StaticData.instance().getPlayersByName().put(player.getName(),player); 46 } 47 48 }

This page was automatically generated by Maven