@Override public int size() { return map.size(); }
/** * returns the keys of the map. * * @return a <code>Set</code> value */ public short[] keys() { short[] keys = new short[size()]; short[] 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 * @see #getValues(Object[]) */ public Object[] getValues() { Object[] vals = new Object[size()]; V[] 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 TShortObjectHashMap)) { return false; } TShortObjectHashMap that = (TShortObjectHashMap) other; if (that.size() != this.size()) { return false; } return forEachEntry(new EqProcedure(that)); }