@Override // GemStoneAddition public int size() { return _map.size(); } @Override // GemStoneAddition
/** * Returns the number of entries in the map. * @return the map's size. */ @Override // GemStoneAddition public int size() { return this._map.size(); }
/** * Returns the values of the map. * * @return a <code>Collection</code> value */ public long[] getValues() { long[] vals = new long[size()]; long[] v = _values; byte[] states = _states; for (int i = v.length, j = 0; i-- > 0;) { if (states[i] == FULL) { vals[j++] = v[i]; } } return vals; }
/** * returns the keys of the map. * * @return a <code>Set</code> value */ public double[] keys() { double[] keys = new double[size()]; double[] k = _set; byte[] states = _states; for (int i = k.length, j = 0; i-- > 0;) { if (states[i] == FULL) { keys[j++] = k[i]; } } return keys; }
/** * Compares this map with another map for equality of their stored * entries. * * @param other an <code>Object</code> value * @return a <code>boolean</code> value */ @Override // GemStoneAddition public boolean equals(Object other) { if (! (other instanceof TDoubleLongHashMap)) { return false; } TDoubleLongHashMap that = (TDoubleLongHashMap)other; if (that.size() != this.size()) { return false; } return forEachEntry(new EqProcedure(that)); }
} else if (other instanceof Map) { Map that = (Map)other; if (that.size() != _map.size()) { return false; // different sizes, no need to compare } else { // now we have to do it the hard way