@Override public boolean contains(int e) { return owner.containsKey(e); }
@Override public int removeAll(final int e) { final boolean hasKey = owner.containsKey(e); if (hasKey) { owner.remove(e); return 1; } else { return 0; } } };
/** * Return true if all keys of some other container exist in this container. */ protected boolean equalElements(IntDoubleHashMap other) { if (other.size() != size()) { return false; } for (IntDoubleCursor c : other) { int key = c.key; if (!containsKey(key) || !(Double.doubleToLongBits(get(key)) == Double.doubleToLongBits(c.value))) { return false; } } return true; }
@Override public boolean contains(int e) { return owner.containsKey(e); }
public boolean containsKey(int key) { return g_map.containsKey(key); }
@Override public int removeAll(final int e) { final boolean hasKey = owner.containsKey(e); if (hasKey) { owner.remove(e); return 1; } else { return 0; } } };
/** * <a href="http://trove4j.sourceforge.net">Trove</a>-inspired API method. An equivalent * of the following code: * <pre> * if (!map.containsKey(key)) map.put(value); * </pre> * * @param key The key of the value to check. * @param value The value to put if <code>key</code> does not exist. * @return <code>true</code> if <code>key</code> did not exist and <code>value</code> * was placed in the map. */ public boolean putIfAbsent(int key, double value) { if (!containsKey(key)) { put(key, value); return true; } else { return false; } }
/** * Return true if all keys of some other container exist in this container. */ protected boolean equalElements(IntDoubleHashMap other) { if (other.size() != size()) { return false; } for (IntDoubleCursor c : other) { int key = c.key; if (!containsKey(key) || !(Double.doubleToLongBits(get(key)) == Double.doubleToLongBits(c.value))) { return false; } } return true; }
/** * If <code>key</code> exists, <code>putValue</code> is inserted into the map, * otherwise any existing value is incremented by <code>additionValue</code>. * * @param key * The key of the value to adjust. * @param putValue * The value to put if <code>key</code> does not exist. * @param incrementValue * The value to add to the existing value if <code>key</code> exists. * @return Returns the current value associated with <code>key</code> (after * changes). */ @Override public double putOrAdd(int key, double putValue, double incrementValue) { assert assigned < mask + 1; if (containsKey(key)) { putValue = get(key); putValue = (double) (((putValue) + (incrementValue))); } put(key, putValue); return putValue; }
outputTable.addRow(names[i], NumberFormat.getInstance().format(value)); }else if(doubleMetrics.containsKey(i)){ double value = doubleMetrics.get(i); if(value != 0){