/** * Adds 1 to the frequency count for v. * <p> * If other objects have already been added to this Frequency, v must * be comparable to those that have already been added. * </p> * * @param v the value to add. * @throws MathIllegalArgumentException if <code>v</code> is not comparable with previous entries */ public void addValue(Comparable<?> v) throws MathIllegalArgumentException { incrementValue(v, 1); }
/** * Increments the frequency count for v. * <p> * If other objects have already been added to this Frequency, v must * be comparable to those that have already been added. * </p> * * @param v the value to add. * @param increment the amount by which the value should be incremented * @throws MathIllegalArgumentException if the table contains entries not * comparable to Long * @since 3.3 */ public void incrementValue(long v, long increment) throws MathIllegalArgumentException { incrementValue(Long.valueOf(v), increment); }
/** * Increments the frequency count for v. * <p> * If other objects have already been added to this Frequency, v must * be comparable to those that have already been added. * </p> * * @param v the value to add. * @param increment the amount by which the value should be incremented * @throws MathIllegalArgumentException if the table contains entries not * comparable to Char * @since 3.3 */ public void incrementValue(char v, long increment) throws MathIllegalArgumentException { incrementValue(Character.valueOf(v), increment); }
/** * Increments the frequency count for v. * <p> * If other objects have already been added to this Frequency, v must * be comparable to those that have already been added. * </p> * * @param v the value to add. * @param increment the amount by which the value should be incremented * @throws MathIllegalArgumentException if the table contains entries not * comparable to Long * @since 3.3 */ public void incrementValue(int v, long increment) throws MathIllegalArgumentException { incrementValue(Long.valueOf(v), increment); }
/** * Merge another Frequency object's counts into this instance. * This Frequency's counts will be incremented (or set when not already set) * by the counts represented by other. * * @param other the other {@link Frequency} object to be merged * @throws NullArgumentException if {@code other} is null * @since 3.1 */ public void merge(final Frequency other) throws NullArgumentException { MathUtils.checkNotNull(other, LocalizedFormats.NULL_NOT_ALLOWED); final Iterator<Map.Entry<Comparable<?>, Long>> iter = other.entrySetIterator(); while (iter.hasNext()) { final Map.Entry<Comparable<?>, Long> entry = iter.next(); incrementValue(entry.getKey(), entry.getValue().longValue()); } }
/** * Adds 1 to the frequency count for v. * <p> * If other objects have already been added to this Frequency, v must * be comparable to those that have already been added. * </p> * * @param v the value to add. * @throws MathIllegalArgumentException if <code>v</code> is not comparable with previous entries */ public void addValue(Comparable<?> v) throws MathIllegalArgumentException { incrementValue(v, 1); }
/** * Adds 1 to the frequency count for v. * <p> * If other objects have already been added to this Frequency, v must * be comparable to those that have already been added. * </p> * * @param v the value to add. * @throws MathIllegalArgumentException if <code>v</code> is not comparable with previous entries */ public void addValue(Comparable<?> v) throws MathIllegalArgumentException { incrementValue(v, 1); }
/** * Increments the frequency count for v. * <p> * If other objects have already been added to this Frequency, v must * be comparable to those that have already been added. * </p> * * @param v the value to add. * @param increment the amount by which the value should be incremented * @throws MathIllegalArgumentException if the table contains entries not * comparable to Long * @since 3.3 */ public void incrementValue(int v, long increment) throws MathIllegalArgumentException { incrementValue(Long.valueOf(v), increment); }
/** * Increments the frequency count for v. * <p> * If other objects have already been added to this Frequency, v must * be comparable to those that have already been added. * </p> * * @param v the value to add. * @param increment the amount by which the value should be incremented * @throws MathIllegalArgumentException if the table contains entries not * comparable to Char * @since 3.3 */ public void incrementValue(char v, long increment) throws MathIllegalArgumentException { incrementValue(Character.valueOf(v), increment); }
/** * Increments the frequency count for v. * <p> * If other objects have already been added to this Frequency, v must * be comparable to those that have already been added. * </p> * * @param v the value to add. * @param increment the amount by which the value should be incremented * @throws MathIllegalArgumentException if the table contains entries not * comparable to Long * @since 3.3 */ public void incrementValue(long v, long increment) throws MathIllegalArgumentException { incrementValue(Long.valueOf(v), increment); }
/** * Increments the frequency count for v. * <p> * If other objects have already been added to this Frequency, v must * be comparable to those that have already been added. * </p> * * @param v the value to add. * @param increment the amount by which the value should be incremented * @throws MathIllegalArgumentException if the table contains entries not * comparable to Char * @since 3.3 */ public void incrementValue(char v, long increment) throws MathIllegalArgumentException { incrementValue(Character.valueOf(v), increment); }
/** * Increments the frequency count for v. * <p> * If other objects have already been added to this Frequency, v must * be comparable to those that have already been added. * </p> * * @param v the value to add. * @param increment the amount by which the value should be incremented * @throws MathIllegalArgumentException if the table contains entries not * comparable to Long * @since 3.3 */ public void incrementValue(int v, long increment) throws MathIllegalArgumentException { incrementValue(Long.valueOf(v), increment); }
/** * Increments the frequency count for v. * <p> * If other objects have already been added to this Frequency, v must * be comparable to those that have already been added. * </p> * * @param v the value to add. * @param increment the amount by which the value should be incremented * @throws MathIllegalArgumentException if the table contains entries not * comparable to Long * @since 3.3 */ public void incrementValue(long v, long increment) throws MathIllegalArgumentException { incrementValue(Long.valueOf(v), increment); }
/** * Merge another Frequency object's counts into this instance. * This Frequency's counts will be incremented (or set when not already set) * by the counts represented by other. * * @param other the other {@link Frequency} object to be merged * @throws NullArgumentException if {@code other} is null * @since 3.1 */ public void merge(final Frequency other) throws NullArgumentException { MathUtils.checkNotNull(other, LocalizedFormats.NULL_NOT_ALLOWED); final Iterator<Map.Entry<Comparable<?>, Long>> iter = other.entrySetIterator(); while (iter.hasNext()) { final Map.Entry<Comparable<?>, Long> entry = iter.next(); incrementValue(entry.getKey(), entry.getValue().longValue()); } }
/** * Merge another Frequency object's counts into this instance. * This Frequency's counts will be incremented (or set when not already set) * by the counts represented by other. * * @param other the other {@link Frequency} object to be merged * @throws NullArgumentException if {@code other} is null * @since 3.1 */ public void merge(final Frequency other) throws NullArgumentException { MathUtils.checkNotNull(other, LocalizedFormats.NULL_NOT_ALLOWED); final Iterator<Map.Entry<Comparable<?>, Long>> iter = other.entrySetIterator(); while (iter.hasNext()) { final Map.Entry<Comparable<?>, Long> entry = iter.next(); incrementValue(entry.getKey(), entry.getValue().longValue()); } }