Theoretical investigation of the use of nanocages with an adsorbed halogen atom as anode materials in metal-ion batteries