public boolean containsValue( int value ){ synchronized( mutex ) { return m.containsValue( value ); } } public int get( int key ) {
public boolean containsValue( int val ) { return m.containsValue( val ); } public int get( int key) { return m.get( key ); }
/** * Checks for the presence of <tt>val</tt> in the values of the map. * * @param val an <code>Object</code> value * @return a <code>boolean</code> value */ public boolean containsValue( Object val ) { return val instanceof Integer && _map.containsValue( unwrapValue( val ) ); }
@Override public boolean containsValue( int value ){ synchronized( mutex ) { return m.containsValue( value ); } } @Override
public boolean containsValue( int value ){ synchronized( mutex ) { return m.containsValue( value ); } } public int get( int key ) {
public boolean containsValue( int value ){ synchronized( mutex ) { return m.containsValue( value ); } } public int get( int key ) {
public boolean containsValue( int val ) { return m.containsValue( val ); } public int get( int key) { return m.get( key ); }
public boolean containsValue( int value ){ synchronized( mutex ) { return m.containsValue( value ); } } public int get( int key ) {
@Override public boolean containsValue( int val ) { return m.containsValue( val ); } @Override
public boolean containsValue( int val ) { return m.containsValue( val ); } public int get( int key) { return m.get( key ); }
public boolean containsValue( int val ) { return m.containsValue( val ); } public int get( int key) { return m.get( key ); }
/** * Checks for the presence of <tt>val</tt> in the values of the map. * * @param val an <code>Object</code> value * @return a <code>boolean</code> value */ public boolean containsValue( Object val ) { return val instanceof Integer && _map.containsValue( unwrapValue( val ) ); }
/** * Checks for the presence of <tt>val</tt> in the values of the map. * * @param val an <code>Object</code> value * @return a <code>boolean</code> value */ public boolean containsValue( Object val ) { return val instanceof Integer && _map.containsValue( unwrapValue( val ) ); }
/** * Checks for the presence of <tt>val</tt> in the values of the map. * * @param val an <code>Object</code> value * @return a <code>boolean</code> value */ public boolean containsValue( Object val ) { return val instanceof Integer && _map.containsValue( unwrapValue( val ) ); }
/** * Checks for the presence of <tt>val</tt> in the values of the map. * * @param val an <code>Object</code> value * @return a <code>boolean</code> value */ @Override public boolean containsValue( Object val ) { return val instanceof Integer && _map.containsValue( unwrapValue( val ) ); }
/** * Filter down a map from target stop indexes to distances so it only includes those stops that are the * closest on some pattern. This is technically incorrect (think of transfers to a U shaped metro from a bus line * running across the legs of the U, a situation which actually exists in Washington, DC with the * red line and the Q4) but anecdotally it speeds up computation by up to 40 percent. We may want to look into * other ways to optimize transfers (or why the transfers are making routing so much slower) if this turns out to * affect results. */ private void retainClosestStopsOnPatterns(TIntIntMap timesToReachedStops) { TIntIntMap bestStopOnPattern = new TIntIntHashMap(50, 0.5f, -1, -1); // For every reached stop, timesToReachedStops.forEachEntry((stopIndex, distanceToStop) -> { // For every pattern passing through that stop, transitLayer.patternsForStop.get(stopIndex).forEach(patternIndex -> { int currentBestStop = bestStopOnPattern.get(patternIndex); // Record this stop if it's the closest one yet seen on that pattern. if (currentBestStop == -1) { bestStopOnPattern.put(patternIndex, stopIndex); } else { int currentBestTime = timesToReachedStops.get(currentBestStop); if (currentBestTime > distanceToStop) { bestStopOnPattern.put(patternIndex, stopIndex); } } return true; // iteration should continue }); return true; // iteration should continue }); timesToReachedStops.retainEntries((stop, distance) -> bestStopOnPattern.containsValue(stop)); }
/** * Filter down a map from target stop indexes to distances so it only includes those stops that are the * closest on some pattern. This is technically incorrect (think of transfers to a U shaped metro from a bus line * running across the legs of the U, a situation which actually exists in Washington, DC with the * red line and the Q4) but anecdotally it speeds up computation by up to 40 percent. We may want to look into * other ways to optimize transfers (or why the transfers are making routing so much slower) if this turns out to * affect results. */ private void retainClosestStopsOnPatterns(TIntIntMap timesToReachedStops) { TIntIntMap bestStopOnPattern = new TIntIntHashMap(50, 0.5f, -1, -1); // For every reached stop, timesToReachedStops.forEachEntry((stopIndex, distanceToStop) -> { // For every pattern passing through that stop, transitLayer.patternsForStop.get(stopIndex).forEach(patternIndex -> { int currentBestStop = bestStopOnPattern.get(patternIndex); // Record this stop if it's the closest one yet seen on that pattern. if (currentBestStop == -1) { bestStopOnPattern.put(patternIndex, stopIndex); } else { int currentBestTime = timesToReachedStops.get(currentBestStop); if (currentBestTime > distanceToStop) { bestStopOnPattern.put(patternIndex, stopIndex); } } return true; // iteration should continue }); return true; // iteration should continue }); timesToReachedStops.retainEntries((stop, distance) -> bestStopOnPattern.containsValue(stop)); }