if ( that.size() != this.size() ) { return false; double value = iter.value(); if ( value == no_entry_value ) { if ( !( that.get( key ) == that.getNoEntryValue() && that.containsKey( key ) ) ) { if ( value != that.get( key ) ) { return false;
@Override public boolean execute(String activityName, long latestExecutionTime) { runningExecutionTotals.adjustOrPutValue(activityName, latestExecutionTime, latestExecutionTime); latestSpike = spikeData.get(activityName); if (latestExecutionTime > latestSpike) { spikeData.put(activityName, latestExecutionTime); } return true; } }
public Set<K> keySet() { if ( keySet == null ) keySet = Collections.unmodifiableSet( m.keySet() ); return keySet; } public Object[] keys() { return m.keys(); }
private void processMetrics(TObjectDoubleMap<String> activitiesToMetricsMap) { activitiesToMetricsMap.retainEntries(matchingCriteria); processedEntries.clear(); activitiesToMetricsMap.forEachEntry(addEntryToProcessedEntries); Collections.sort(processedEntries, inAscendingAlphabeticalOrder); for (MetricsEntry entry : processedEntries) { builder.append(String.format("%,10.2f", entry.metricsValue)); builder.append("ms - "); builder.append(entry.activityName); builder.append("\n"); } }
/** * Retrieves the value for <tt>key</tt> * * @param key an <code>Object</code> value * @return the value of <tt>key</tt> or null if no such mapping exists. */ public Double get( Object key ) { double v = _map.get( key ); // There may be a false positive since primitive maps // cannot return null, so we have to do an extra // check here. if ( v == _map.getNoEntryValue() ) { return null; } else { return wrapValue( v ); } }
@Override public double getDoubleProperty(String propertyKey, double fallback) { return this.doubleProperties.containsKey(propertyKey) ? this.doubleProperties.get(propertyKey) : fallback; }
if (!vertices.containsKey(v)) { vertices.put(v, (int) s.getWeight()); // FIXME time or weight? is RR using right mode? LOG.debug("Heuristric street search hit {} vertices.", vertices.size()); LOG.debug("Heuristric street search hit {} transit stops.", transitQueue.size()); return vertices;
/** * Inserts a key/value pair into the map. * * @param key an <code>Object</code> value * @param value an <code>Double</code> value * @return the previous value associated with <tt>key</tt>, * or Integer(0) if none was found. */ public Double put( K key, Double value ) { if ( value == null ) return wrapValue( _map.put( key, _map.getNoEntryValue() ) ); return wrapValue( _map.put( key, unwrapValue( value ) ) ); }
@Override public boolean execute(String activityName, double executionTime) { spikeData.put(activityName, executionTime * DECAY_RATE); return true; } }
/** * Checks for the present of <tt>key</tt> in the keys of the map. * * @param key an <code>Object</code> value * @return a <code>boolean</code> value */ public boolean containsKey( Object key ) { return _map.containsKey( key ); }
/** * Indicates whether map has any entries. * * @return true if the map is empty */ public boolean isEmpty() { return this._map.size() == 0; }
allTaxa.or(taxa); if (taxa.getCardinality() > 1) //add characters and merge identical ones charCandidates.adjustOrPutValue(taxa, hyperedge.getWeight(), hyperedge.getWeight()); for (Hyperedge hyperedge : sourceGraph.hyperEdges()) { if (!charCandidates.adjustValue(hyperedge.ones(), hyperedge.getWeight())) { charCandidates.put(hyperedge.ones().clone(), hyperedge.getWeight()); allTaxa.or(hyperedge.ones());
public TObjectDoubleIterator<K> iterator() { return m.iterator(); // Must be manually synched by user! }
public double get( Object key ) { synchronized( mutex ) { return m.get( key ); } }
/** {@inheritDoc} */ public void putAll( TObjectDoubleMap<? extends K> map ){ map.forEachEntry( PUT_ALL_PROC ); }
ids.put(ks.phrase2, ks.wpId2); counts.adjustOrPutValue(ks.phrase2, 1, 1); sums.adjustOrPutValue(ks.phrase2, ks.similarity, ks.similarity); double mean = sums.get(phrase2) / counts.get(phrase2); if (mean >= threshold) { mostSimilar.add(new KnownSim(phrase, phrase2, pageId, ids.get(phrase2), mean, language));
/** * Empties the map. */ public void clear() { this._map.clear(); }
/** * Creates a new <code>TObjectDoubleHashMap</code> that contains the entries * in the map passed to it. * * @param map the <tt>TObjectDoubleMap</tt> to be copied. */ public TObjectDoubleHashMap( TObjectDoubleMap<? extends K> map ) { this( map.size(), 0.5f, map.getNoEntryValue() ); if ( map instanceof TObjectDoubleHashMap ) { TObjectDoubleHashMap hashmap = ( TObjectDoubleHashMap ) map; this._loadFactor = hashmap._loadFactor; this.no_entry_value = hashmap.no_entry_value; //noinspection RedundantCast if ( this.no_entry_value != ( double ) 0 ) { Arrays.fill( _values, this.no_entry_value ); } setUp( (int) Math.ceil( DEFAULT_CAPACITY / _loadFactor ) ); } putAll( map ); }
public double adjustOrPutValue( K key, double adjust_amount, double put_amount ) { synchronized( mutex ) { return m.adjustOrPutValue( key, adjust_amount, put_amount ); } }
public boolean adjustValue( K key, double amount ) { synchronized( mutex ) { return m.adjustValue( key, amount ); } } public double adjustOrPutValue( K key, double adjust_amount, double put_amount ) {