I plan to create a representation of a 2D (topographical) map in Android (3.0) in the following way
- a class
MapCoordinate
, which is just a 'struct' and consist of public attributes x,y of type int and represents a MapCoordinate - a class
MapPoint
(not a good name probably), which encapsulates methods to access and alter data of a point in a map (for one map coordinate) a class
Map
, which has one instance / Map (there is only one in my app) and encapsulates a Map by having aHashMap
:public class Map { HashMap<MapCoordinate, MapPoint> mapPoint = new HashMap<MapCoordinate, MapPoint>(); }
So, my question would be: Is it performance-critical to have many (Java) object instances on Android (only tablet PCs are the target of my app). Of course this map is only a tiny fragment of my whole application. The map can get rather large.
Thanks for your feedback.