Refactoring

This commit is contained in:
Roman Inflianskas 2016-05-25 11:22:53 +03:00
parent cde96e5848
commit 61bfbdc3ed

View file

@ -152,7 +152,6 @@ public class BinaryMapPoiReaderAdapter {
} }
} }
protected void readPoiIndex(PoiRegion region, boolean readCategories) throws IOException { protected void readPoiIndex(PoiRegion region, boolean readCategories) throws IOException {
int length; int length;
int oldLimit; int oldLimit;
@ -370,7 +369,8 @@ public class BinaryMapPoiReaderAdapter {
offset = codedIS.getTotalBytesRead(); offset = codedIS.getTotalBytesRead();
map.readIndexedStringTable(instance, query, "", dataOffsets, 0); map.readIndexedStringTable(instance, query, "", dataOffsets, 0);
codedIS.popLimit(oldLimit); codedIS.popLimit(oldLimit);
break; } break;
}
case OsmandOdb.OsmAndPoiNameIndex.DATA_FIELD_NUMBER: { case OsmandOdb.OsmAndPoiNameIndex.DATA_FIELD_NUMBER: {
if (dataOffsets != null) { if (dataOffsets != null) {
dataOffsets.sort(); // 1104125 dataOffsets.sort(); // 1104125
@ -387,7 +387,8 @@ public class BinaryMapPoiReaderAdapter {
} }
} }
codedIS.skipRawBytes(codedIS.getBytesUntilLimit()); codedIS.skipRawBytes(codedIS.getBytesUntilLimit());
return offsets; } return offsets;
}
default: default:
skipUnknownField(t); skipUnknownField(t);
break; break;
@ -414,7 +415,6 @@ public class BinaryMapPoiReaderAdapter {
break; break;
} }
} }
} }
private void readPoiNameIndexDataAtom(TIntLongHashMap offsets, SearchRequest<Amenity> req) throws IOException { private void readPoiNameIndexDataAtom(TIntLongHashMap offsets, SearchRequest<Amenity> req) throws IOException {
@ -659,6 +659,7 @@ public class BinaryMapPoiReaderAdapter {
} }
return arp; return arp;
} }
private Amenity readPoiPoint(int left31, int right31, int top31, int bottom31, private Amenity readPoiPoint(int left31, int right31, int top31, int bottom31,
int px, int py, int zoom, SearchRequest<Amenity> req, PoiRegion region, boolean checkBounds) throws IOException { int px, int py, int zoom, SearchRequest<Amenity> req, PoiRegion region, boolean checkBounds) throws IOException {
Amenity am = null; Amenity am = null;
@ -753,7 +754,6 @@ public class BinaryMapPoiReaderAdapter {
am.setSubType(am.getSubType() + ";" + subtype); am.setSubType(am.getSubType() + ";" + subtype);
} }
} }
break; break;
case OsmandOdb.OsmAndPoiBoxDataAtom.ID_FIELD_NUMBER: case OsmandOdb.OsmAndPoiBoxDataAtom.ID_FIELD_NUMBER:
am.setId(codedIS.readUInt64()); am.setId(codedIS.readUInt64());
@ -819,7 +819,6 @@ public class BinaryMapPoiReaderAdapter {
codedIS.skipRawBytes(codedIS.getBytesUntilLimit()); codedIS.skipRawBytes(codedIS.getBytesUntilLimit());
return true; return true;
} }
break; break;
default: default:
skipUnknownField(t); skipUnknownField(t);
@ -871,7 +870,6 @@ public class BinaryMapPoiReaderAdapter {
existsCategories = true; existsCategories = true;
} }
break; break;
case OsmandOdb.OsmAndPoiBox.SUBBOXES_FIELD_NUMBER: { case OsmandOdb.OsmAndPoiBox.SUBBOXES_FIELD_NUMBER: {
int x = dx + (px << (zoom - pzoom)); int x = dx + (px << (zoom - pzoom));
int y = dy + (py << (zoom - pzoom)); int y = dy + (py << (zoom - pzoom));
@ -901,7 +899,8 @@ public class BinaryMapPoiReaderAdapter {
return true; return true;
} }
} }
} break; }
break;
case OsmandOdb.OsmAndPoiBox.SHIFTTODATA_FIELD_NUMBER: { case OsmandOdb.OsmAndPoiBox.SHIFTTODATA_FIELD_NUMBER: {
int x = dx + (px << (zoom - pzoom)); int x = dx + (px << (zoom - pzoom));
int y = dy + (py << (zoom - pzoom)); int y = dy + (py << (zoom - pzoom));
@ -922,7 +921,8 @@ public class BinaryMapPoiReaderAdapter {
offsetsMap.put(offset, -1); offsetsMap.put(offset, -1);
} }
} }
} break; }
break;
default: default:
skipUnknownField(t); skipUnknownField(t);
break; break;