package net.osmand.binary; import gnu.trove.map.hash.TIntObjectHashMap; import net.osmand.binary.BinaryMapIndexReader.MapIndex; import net.osmand.render.RenderingRulesStorage; public class BinaryMapDataObject { protected int[] coordinates = null; protected int[][] polygonInnerCoordinates = null; protected boolean area = false; protected int[] types = null; protected int[] additionalTypes = null; protected int objectType = RenderingRulesStorage.POINT_RULES; protected TIntObjectHashMap objectNames = null; protected long id = 0; protected MapIndex mapIndex = null; public BinaryMapDataObject(){ } public BinaryMapDataObject(int[] coordinates, int[] types, int[][] polygonInnerCoordinates, long id){ this.polygonInnerCoordinates = polygonInnerCoordinates; this.coordinates = coordinates; this.additionalTypes = new int[0]; this.types = types; this.id = id; } protected void setCoordinates(int[] coordinates) { this.coordinates = coordinates; } public String getName(){ if(objectNames == null){ return ""; } String name = objectNames.get(mapIndex.nameEncodingType); if(name == null){ return ""; } return name; } public TIntObjectHashMap getObjectNames() { return objectNames; } public void putObjectName(int type, String name){ if(objectNames == null){ objectNames = new TIntObjectHashMap(); } objectNames.put(type, name); } public int[][] getPolygonInnerCoordinates() { return polygonInnerCoordinates; } public int[] getTypes(){ return types; } public boolean containsType(int cachedType) { if(cachedType != -1) { for(int i=0; i