/** {@inheritDoc} */ public boolean containsKey( long key ) { return contains( key ); }
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); } } }
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); } } } } }
if (ro.getPoint31XTile(i) == x31 && ro.getPoint31YTile(i) == y31) { long id = calcRouteId(ro, i); if (excludeDuplications.contains(id)) { continue;
class TLongObjectHashIterator<V> extends THashPrimitiveIterator implements TLongObjectIterator<V> { /** the collection being iterated over */ private final TLongObjectHashMap<V> _map; /** * Creates an iterator over the specified map * * @param map map to iterate over. */ public TLongObjectHashIterator( TLongObjectHashMap<V> map ) { super( map ); this._map = map; } /** {@inheritDoc} */ public void advance() { moveToNextIndex(); } /** {@inheritDoc} */ public long key() { return _map._set[_index]; } /** {@inheritDoc} */ public V value() { return _map._values[_index]; }
long zx = x << (SearchRequest.ZOOM_TO_SEARCH_POI - zoom); long zy = y << (SearchRequest.ZOOM_TO_SEARCH_POI - zoom); read = req.tiles.contains((zx << SearchRequest.ZOOM_TO_SEARCH_POI) + zy);
if(!loadedTransportStops.contains(s.getId())) { loadedTransportStops.put(s.getId(), s); allPoints.addAll(s.getReferencesToRoutes());
@Override public boolean execute(TDWay way) { if (way == null) { return true; } if (++this.nWays % 10000 == 0) { if (progressLogs) { System.out.print("Progress: Ways " + nfCounts.format(this.nWays) + " / " + nfCounts.format(getWaysNumber()) + "\r"); } } // we only consider ways that have tags and which have not already // added as outer way of a relation // inner ways without additional tags are also not considered as they are processed as part of a // multi polygon if (way.isRenderRelevant() && !BaseTileBasedDataProcessor.this.outerToInnerMapping.contains(way.getId()) && !BaseTileBasedDataProcessor.this.innerWaysWithoutAdditionalTags.contains(way.getId())) { // TODO #HDstoreData: integrate all way processes from HD and RAM Processor HERE // e.g. outerToInnerMapping, virtualWays, associatedRelations, implicitRelations // or declare better that HD Processor does not store object data before writing to file addImplicitRelationInformation(way); addWayToTiles(way, BaseTileBasedDataProcessor.this.bboxEnlargement); } return true; } }
if (BaseTileBasedDataProcessor.this.outerToInnerMapping.contains(outerWay.getId())) { shape = TDWay.MULTI_POLYGON;
/** {@inheritDoc} */ @Override public boolean containsKey( long key ) { return contains( key ); }
/** {@inheritDoc} */ public boolean containsKey( long key ) { return contains( key ); }
/** {@inheritDoc} */ public boolean containsKey( long key ) { return contains( key ); }
synchronized boolean isRecorded(long id) { return rollbackLog.contains(id); }
/** {@inheritDoc} */ public boolean containsKey( long key ) { return contains( key ); }
/** * Check if a reference frame has already been registered * @param referenceFrame * @return true if the reference frame has already been registered, false otherwise. */ public boolean isReferenceFrameRegistered(ReferenceFrame referenceFrame) { return referenceFrames.contains(referenceFrame.hashCode()); }
if (this.outerToInnerMapping.contains(way.getId())) { way.setShape(TDWay.MULTI_POLYGON);
class TLongObjectHashIterator<V> extends THashPrimitiveIterator implements TLongObjectIterator<V> { /** the collection being iterated over */ private final TLongObjectHashMap<V> _map; /** * Creates an iterator over the specified map * * @param map map to iterate over. */ public TLongObjectHashIterator( TLongObjectHashMap<V> map ) { super( map ); this._map = map; } /** {@inheritDoc} */ public void advance() { moveToNextIndex(); } /** {@inheritDoc} */ public long key() { return _map._set[_index]; } /** {@inheritDoc} */ public V value() { return _map._values[_index]; }
/** * Convert to Kronecker's representation */ private TLongObjectHashMap<CfHolder> toKronecker(long[] kroneckerMap) { TLongObjectHashMap<CfHolder> result = new TLongObjectHashMap<>(size()); for (MonomialZp64 term : this) { long exponent = term.exponents[0]; for (int i = 1; i < term.exponents.length; i++) exponent += term.exponents[i] * kroneckerMap[i]; assert !result.contains(exponent); result.put(exponent, new CfHolder(term.coefficient)); } return result; }
/** * Change the current reference frame for another one that has already been registered. * @param newCurrentReferenceFrame * @return ReferenceFrame the previous current reference frame */ public ReferenceFrame switchCurrentReferenceFrame(ReferenceFrame newCurrentReferenceFrame) { ReferenceFrame previousReferenceFrame = getCurrentReferenceFrame(); if(!referenceFrames.contains(newCurrentReferenceFrame.hashCode())) { throw new RuntimeException("The frame: " + newCurrentReferenceFrame.getName() + " has not been registered."); } currentFrameId.set(newCurrentReferenceFrame.hashCode()); return previousReferenceFrame; }
/** * Convert to Kronecker's representation */ private TLongObjectHashMap<CfHolder<E>> toKronecker(long[] kroneckerMap) { TLongObjectHashMap<CfHolder<E>> result = new TLongObjectHashMap<>(size()); for (Monomial<E> term : this) { long exponent = term.exponents[0]; for (int i = 1; i < term.exponents.length; i++) exponent += term.exponents[i] * kroneckerMap[i]; assert !result.contains(exponent); result.put(exponent, new CfHolder<>(term.coefficient)); } return result; }