/** * Returns <tt>true</tt> if the receiver contains the specified value. * * @return <tt>true</tt> if the receiver contains the specified value. */ public boolean containsValue(Object value) { return indexOfValue(value) >= 0; } /**
/** * Returns <tt>true</tt> if the receiver contains the specified value. * * @return <tt>true</tt> if the receiver contains the specified value. */ public boolean containsValue(Object value) { return indexOfValue(value) >= 0; } /**
/** * Returns <tt>true</tt> if the receiver contains the specified value. * * @return <tt>true</tt> if the receiver contains the specified value. */ public boolean containsValue(T value) { return indexOfValue(value) >= 0; }
/** * Returns the first key the given value is associated with. * It is often a good idea to first check with {@link #containsValue(Object)} whether there exists an association from a key to this value. * Search order is guaranteed to be <i>identical</i> to the order used by method {@link #forEachKey(LongProcedure)}. * * @param value the value to search for. * @return the first key for which holds <tt>get(key) == value</tt>; * returns <tt>Long.MIN_VALUE</tt> if no such key exists. */ public long keyOf(Object value) { //returns the first key found; there may be more matching keys, however. int i = indexOfValue(value); if (i<0) return Long.MIN_VALUE; return table[i]; } /**
/** * Returns the first key the given value is associated with. * It is often a good idea to first check with {@link #containsValue(Object)} whether there exists an association from a key to this value. * Search order is guaranteed to be <i>identical</i> to the order used by method {@link #forEachKey(LongProcedure)}. * * @param value the value to search for. * @return the first key for which holds <tt>get(key) == value</tt>; * returns <tt>Long.MIN_VALUE</tt> if no such key exists. */ public long keyOf(Object value) { //returns the first key found; there may be more matching keys, however. int i = indexOfValue(value); if (i<0) return Long.MIN_VALUE; return table[i]; } /**
/** * Returns the first key the given value is associated with. It is often a * good idea to first check with {@link #containsValue(Object)} whether * there exists an association from a key to this value. Search order is * guaranteed to be <i>identical</i> to the order used by method * {@link #forEachKey(LongProcedure)}. * * @param value * the value to search for. * @return the first key for which holds <tt>get(key) == value</tt>; returns * <tt>Long.MIN_VALUE</tt> if no such key exists. */ public long keyOf(T value) { // returns the first key found; there may be more matching keys, // however. int i = indexOfValue(value); if (i < 0) return Long.MIN_VALUE; return table[i]; }