public boolean execute( long key, V value) { put( key, value ); return true; } };
public void set(long index, T value) { vector.put(index, value); }
public void set(long index, T value) { vector.put(index, value); }
/** {@inheritDoc} */ public void putAll( Map<? extends Long, ? extends V> map ) { Set<? extends Map.Entry<? extends Long,? extends V>> set = map.entrySet(); for ( Map.Entry<? extends Long,? extends V> entry : set ) { put( entry.getKey(), entry.getValue() ); } }
private long addObject(T object, long tile) { if(!objects.containsKey(tile)){ objects.put(tile, new ArrayList<T>()); } objects.get(tile).add(object); return tile; }
public void loadAllObjects(final List<RouteDataObject> toFillIn, RoutingContext ctx, TLongObjectHashMap<RouteDataObject> excludeDuplications) { if(routes != null) { Iterator<RouteSegment> it = routes.valueCollection().iterator(); while(it.hasNext()){ RouteSegment rs = it.next(); while(rs != null){ RouteDataObject ro = rs.road; if (!excludeDuplications.contains(ro.id)) { excludeDuplications.put(ro.id, ro); toFillIn.add(ro); } rs = rs.next; } } } else if(searchResult != null) { RouteDataObject[] objects = searchResult.objects; if(objects != null) { for(RouteDataObject ro : objects) { if (ro != null && !excludeDuplications.contains(ro.id)) { excludeDuplications.put(ro.id, ro); toFillIn.add(ro); } } } } }
@SuppressWarnings({"unchecked"}) public void readExternal( ObjectInput in ) throws IOException, ClassNotFoundException { // VERSION in.readByte(); // SUPER super.readExternal( in ); // NO_ENTRY_KEY no_entry_key = in.readLong(); // NUMBER OF ENTRIES int size = in.readInt(); setUp( size ); // ENTRIES while (size-- > 0) { long key = in.readLong(); V val = (V) in.readObject(); put(key, val); } }
private List<TransportRouteSegment> loadNativeTransportStops(int sx, int sy, boolean change, List<TransportRouteSegment> res) throws IOException { long nanoTime = System.nanoTime(); int d = change ? walkChangeRadiusIn31 : walkRadiusIn31; int lx = (sx - d ) >> (31 - cfg.ZOOM_TO_LOAD_TILES); int rx = (sx + d ) >> (31 - cfg.ZOOM_TO_LOAD_TILES); int ty = (sy - d ) >> (31 - cfg.ZOOM_TO_LOAD_TILES); int by = (sy + d ) >> (31 - cfg.ZOOM_TO_LOAD_TILES); for(int x = lx; x <= rx; x++) { for(int y = ty; y <= by; y++) { int tileId = x << (cfg.ZOOM_TO_LOAD_TILES + 1) + y; List<TransportRouteSegment> list = quadTree.get(tileId); if(list == null) { list = loadTile(x, y); quadTree.put(tileId, list); } for(TransportRouteSegment r : list) { TransportStop st = r.getStop(r.segStart); if (Math.abs(st.x31 - sx) > walkRadiusIn31 || Math.abs(st.y31 - sy) > walkRadiusIn31) { wrongLoadedWays++; } else { loadedWays++; res.add(r); } } } } loadTime += System.nanoTime() - nanoTime; return res; }
private void getAllObjects(long tileId, final List<RouteDataObject> toFillIn, TLongObjectHashMap<RouteDataObject> excludeDuplications) { if (tileRoutes.containsKey(tileId)) { List<RouteDataObject> routes = tileRoutes.get(tileId); if (routes != null) { for (RouteDataObject ro : routes) { if (!excludeDuplications.contains(ro.id)) { excludeDuplications.put(ro.id, ro); toFillIn.add(ro); } } } } List<RoutingSubregionTile> subregions = indexedSubregions.get(tileId); if (subregions != null) { for (RoutingSubregionTile rs : subregions) { rs.loadAllObjects(toFillIn, this, excludeDuplications); } } }
if (createIfEmpty && bin == null) { bin = new ArrayList<>(); bins.put(mapKey, bin); nBins++;
long hash = (((long) x) << SearchRequest.ZOOM_TO_SEARCH_POI) + y; if (!zooms.containsKey(hash)) { zooms.put(hash, new LinkedList<Location>());
indexedSubregions.put(tileId, collection);
prev.next = ri; } else { restrictions.put(from, ri);
RouteDataObject toCmp = excludeDuplications.get(calcRouteId(ro, segment.getSegmentStart())); if (toCmp == null || toCmp.getPointsLength() < ro.getPointsLength()) { excludeDuplications.put(calcRouteId(ro, segment.getSegmentStart()), ro); RouteSegment s = new RouteSegment(ro, segment.getSegmentStart()); s.next = original; segment.next = original; original = segment; excludeDuplications.put(calcRouteId(ro, i), ro);
continue; excludeDuplications.put(id, ro); RouteSegment segment = new RouteSegment(ro, i); segment.next = original;
for(TransportStop s : stops) { if(!loadedTransportStops.contains(s.getId())) { loadedTransportStops.put(s.getId(), s); allPoints.addAll(s.getReferencesToRoutes());
@Override public void addRelation(Relation relation) { super.addRelation(relation); TDRelation tdRelation = TDRelation.fromRelation(relation, this, this.preferredLanguages); if (tdRelation != null) { this.multipolygons.put(relation.getId(), tdRelation); } }
@Override public void addWay(Way way) { super.addWay(way); TDWay tdWay = TDWay.fromWay(way, this, this.preferredLanguages); if (tdWay == null) { return; } this.ways.put(tdWay.getId(), tdWay); this.maxWayID = Math.max(this.maxWayID, way.getId()); prepareImplicitWayRelations(tdWay); }
visitedSegments.put(calculateRoutePointId(segment.getRoad(), segment.isPositive() ? segmentPoint - 1 : segmentPoint, segment.isPositive()), previous != null ? previous : segment); final int x = road.getPoint31XTile(segmentPoint);