/** * Returns the number of entries in the map. * @return the map's size. */ public int size() { return this._map.size(); }
public int size() { return infos.size(); } }
public int size() { return _map.size(); } public boolean isEmpty() {
/** * returns the keys of the map. * * @return a <code>Set</code> value */ public long[] keys() { long[] keys = new long[size()]; long[] k = _set; byte[] states = _states; for (int i = k.length, j = 0; i-- > 0;) { if (states[i] == FULL) { keys[j++] = k[i]; } } return keys; }
/** * Returns the values of the map. * * @return a <code>Collection</code> value */ public Object[] getValues() { Object[] vals = new Object[size()]; Object[] v = _values; byte[] states = _states; for (int i = v.length, j = 0; i-- > 0;) { if (states[i] == FULL) { vals[j++] = v[i]; } } return vals; }
/** * 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 */ public boolean equals(Object other) { if (! (other instanceof TLongObjectHashMap)) { return false; } TLongObjectHashMap that = (TLongObjectHashMap)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