/*********************************************************************************************************** * * Returns {@code true} if this object matches the other CDDB within a given threshold. * * @param other the other CDDB * @param threshold the threshold of the comparison * @return {@code true} if this object matches * **********************************************************************************************************/ public boolean matches (final @Nonnull Cddb other, final @Nonnegative int threshold) { if (Arrays.equals(this.trackFrameOffsets, other.trackFrameOffsets)) { return true; } if (!this.sameTrackCountOf(other)) { return false; } return this.computeDifference(other) <= threshold; }