final public boolean containsValue(T value) throws IllegalArgumentException { if (isNullObjectForm(value)) { return true; } else { try { //if no key found, it will throw exception getIdFromValueImpl(value, 0); } catch (IllegalArgumentException e) { return false; } return true; } }
/** * Returns the ID integer of given value. In case of not found * <p> * - if roundingFlag=0, throw IllegalArgumentException; <br> * - if roundingFlag<0, the closest smaller ID integer if exist; <br> * - if roundingFlag>0, the closest bigger ID integer if exist. <br> * <p> * The implementation often has cache, thus faster than the byte[] version getIdFromValueBytes() * * @throws IllegalArgumentException * if value is not found in dictionary and rounding is off; * or if rounding cannot find a smaller or bigger ID */ final public int getIdFromValue(T value, int roundingFlag) throws IllegalArgumentException { if (isNullObjectForm(value)) return nullId(); int id = getIdFromValueImpl(value, roundingFlag); if (id == -1) { throw new IllegalArgumentException("Value : " + value + " not exists"); } return id; }
final public boolean containsValue(T value) throws IllegalArgumentException { if (isNullObjectForm(value)) { return true; } else { try { //if no key found, it will throw exception getIdFromValueImpl(value, 0); } catch (IllegalArgumentException e) { return false; } return true; } }
/** * Returns the ID integer of given value. In case of not found * <p> * - if roundingFlag=0, throw IllegalArgumentException; <br> * - if roundingFlag<0, the closest smaller ID integer if exist; <br> * - if roundingFlag>0, the closest bigger ID integer if exist. <br> * <p> * The implementation often has cache, thus faster than the byte[] version getIdFromValueBytes() * * @throws IllegalArgumentException * if value is not found in dictionary and rounding is off; * or if rounding cannot find a smaller or bigger ID */ final public int getIdFromValue(T value, int roundingFlag) throws IllegalArgumentException { if (isNullObjectForm(value)) return nullId(); int id = getIdFromValueImpl(value, roundingFlag); if (id == -1) { throw new IllegalArgumentException("Value : " + value + " not exists"); } return id; }
/** * Returns the ID integer of given value. In case of not found * <p> * - if roundingFlag=0, throw IllegalArgumentException; <br> * - if roundingFlag<0, the closest smaller ID integer if exist; <br> * - if roundingFlag>0, the closest bigger ID integer if exist. <br> * <p> * The implementation often has cache, thus faster than the byte[] version getIdFromValueBytes() * * @throws IllegalArgumentException * if value is not found in dictionary and rounding is off or * failed */ final public int getIdFromValue(T value, int roundingFlag) throws IllegalArgumentException { if (isNullObjectForm(value)) return nullId(); else return getIdFromValueImpl(value, roundingFlag); }