Code example for ConcurrentHashMap

Methods: values

0
 
	private GamePhysics gamePhysics; 
	private ConcurrentHashMap<Integer, GameObject> gameObjects = new ConcurrentHashMap<Integer, GameObject>(); 
 
	public Collection<GameObject> getGameObjects() { 
		return gameObjects.values(); 
	} 
 
	public void addGameObject(GameObject gameObject) { 
		gameObjects.put(gameObject.getId(), gameObject); 
	} 
 
	public void removeGameObject(int id) { 
		gameObjects.remove(id); 
	} 
 
	public GameObject getGameObject(int id) { 
		return gameObjects.get(id); 
	} 
 
	public void update(GameRenderingInfo renderingInfo) {