/** * checks for the presence of <tt>val</tt> in the values of the map. * * @param val an <code>Object</code> value * @return a <code>boolean</code> value */ public boolean containsValue(Object val) { Object[] set = _set; V[] vals = _values; // special case null values so that we don't have to // perform null checks before every call to equals() if (null == val) { for (int i = vals.length; i-- > 0;) { if ((set[i] != FREE && set[i] != REMOVED) && val == vals[i]) { return true; } } } else { for (int i = vals.length; i-- > 0;) { if ((set[i] != FREE && set[i] != REMOVED) && (val == vals[i] || equals(val, vals[i]))) { return true; } } } // end of else return false; }
@Override public boolean equals(Object other) { if (other instanceof THashMap) { return ((THashMap<?, ?>) other).delegate.equals(delegate); } return false; }
@Override public boolean equals(Object other) { if (other instanceof THashMap) { return ((THashMap<?, ?>) other).delegate.equals(delegate); } return false; }
/** * checks for the presence of <tt>val</tt> in the values of the map. * * @param val an <code>Object</code> value * @return a <code>boolean</code> value */ public boolean containsValue(Object val) { Object[] set = _set; V[] vals = _values; // special case null values so that we don't have to // perform null checks before every call to equals() if (null == val) { for (int i = vals.length; i-- > 0;) { if ((set[i] != FREE && set[i] != REMOVED) && val == vals[i]) { return true; } } } else { for (int i = vals.length; i-- > 0;) { if ((set[i] != FREE && set[i] != REMOVED) && (val == vals[i] || equals(val, vals[i]))) { return true; } } } // end of else return false; }
/** * checks for the presence of <tt>val</tt> in the values of the map. * * @param val an <code>Object</code> value * @return a <code>boolean</code> value */ public boolean containsValue(Object val) { Object[] set = _set; V[] vals = _values; // special case null values so that we don't have to // perform null checks before every call to equals() if (null == val) { for (int i = vals.length; i-- > 0;) { if ((set[i] != FREE && set[i] != REMOVED) && val == vals[i]) { return true; } } } else { for (int i = vals.length; i-- > 0;) { if ((set[i] != FREE && set[i] != REMOVED) && (val == vals[i] || equals(val, vals[i]))) { return true; } } } // end of else return false; }
/** * checks for the presence of <tt>val</tt> in the values of the map. * * @param val an <code>Object</code> value * @return a <code>boolean</code> value */ @Override public boolean containsValue(Object val) { Object[] set = _set; V[] vals = _values; // special case null values so that we don't have to // perform null checks before every call to equals() if (null == val) { for (int i = vals.length; i-- > 0;) { if ((set[i] != FREE && set[i] != REMOVED) && val == vals[i]) { return true; } } } else { for (int i = vals.length; i-- > 0;) { if ((set[i] != FREE && set[i] != REMOVED) && (val == vals[i] || equals(val, vals[i]))) { return true; } } } // end of else return false; }
/** * checks for the presence of <tt>val</tt> in the values of the map. * * @param val an <code>Object</code> value * @return a <code>boolean</code> value */ public boolean containsValue( Object val ) { Object[] set = _set; V[] vals = _values; // special case null values so that we don't have to // perform null checks before every call to equals() if ( null == val ) { for ( int i = vals.length; i-- > 0; ) { if ( ( set[i] != FREE && set[i] != REMOVED ) && val == vals[i] ) { return true; } } } else { for ( int i = vals.length; i-- > 0; ) { if ( ( set[i] != FREE && set[i] != REMOVED ) && ( val == vals[i] || equals( val, vals[i] ) ) ) { return true; } } } // end of else return false; }
/** * 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. */ @SuppressWarnings({"unchecked"}) public V get( Object key ) { int index = index( key ); if ( index < 0 || ! equals( _set[index], key ) ) { return null; } return _values[index]; }