@Test public void testComparatorWithSoundex() throws Exception { final StringEncoderComparator sCompare = new StringEncoderComparator( new Soundex() ); assertTrue( "O'Brien and O'Brian didn't come out with " + "the same Soundex, something must be wrong here", 0 == sCompare.compare( "O'Brien", "O'Brian" ) ); }
@Override public int compare(final Object o1, final Object o2) { int compareCode = 0; try { @SuppressWarnings("unchecked") final Comparable<Comparable<?>> s1 = (Comparable<Comparable<?>>) this.stringEncoder.encode(o1); final Comparable<?> s2 = (Comparable<?>) this.stringEncoder.encode(o2); compareCode = s1.compareTo(s2); } catch (final EncoderException ee) { compareCode = 0; } return compareCode; }
StringEncoderComparator implements Comparator { @Override public int compare(final Object o1, final Object o2) { int compareCode = 0; try { @SuppressWarnings("unchecked") final Comparable<Comparable<?>> s1 = (Comparable<Comparable<?>>) this.stringEncoder.encode(o1); final Comparable<?> s2 = (Comparable<?>) this.stringEncoder.encode(o2); compareCode = s1.compareTo(s2); } catch (final EncoderException ee) { compareCode = 0; } return compareCode; } }
StringEncoderComparator implements Comparator { @Override public int compare(final Object o1, final Object o2) { int compareCode = 0; try { @SuppressWarnings("unchecked") final Comparable<Comparable<?>> s1 = (Comparable<Comparable<?>>) this.stringEncoder.encode(o1); final Comparable<?> s2 = (Comparable<?>) this.stringEncoder.encode(o2); compareCode = s1.compareTo(s2); } catch (final EncoderException ee) { compareCode = 0; } return compareCode; } @Deprecated  StringEncoderComparator();  StringEncoderComparator(final StringEncoder stringEncoder); }
StringEncoderComparator implements Comparator { @Override public int compare(final Object o1, final Object o2) { int compareCode = 0; try { @SuppressWarnings("unchecked") final Comparable<Comparable<?>> s1 = (Comparable<Comparable<?>>) this.stringEncoder.encode(o1); final Comparable<?> s2 = (Comparable<?>) this.stringEncoder.encode(o2); compareCode = s1.compareTo(s2); } catch (final EncoderException ee) { compareCode = 0; } return compareCode; } @Deprecated  StringEncoderComparator();  StringEncoderComparator(final StringEncoder stringEncoder); @Override int compare(final Object o1, final Object o2); }
StringEncoderComparator implements Comparator { @Override public int compare(final Object o1, final Object o2) { int compareCode = 0; try { @SuppressWarnings("unchecked") final Comparable<Comparable<?>> s1 = (Comparable<Comparable<?>>) this.stringEncoder.encode(o1); final Comparable<?> s2 = (Comparable<?>) this.stringEncoder.encode(o2); compareCode = s1.compareTo(s2); } catch (final EncoderException ee) { compareCode = 0; } return compareCode; } @Deprecated  StringEncoderComparator();  StringEncoderComparator(final StringEncoder stringEncoder); @Override int compare(final Object o1, final Object o2);  }