Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.commons.codec.language
Class AbstractCaverphone

    java.lang.Object
      org.apache.commons.codec.language.AbstractCaverphone

All Implemented Interfaces:
  Encoder, StringEncoder

Direct Known Subclasses:
  Caverphone1, Caverphone2

    public abstract class AbstractCaverphone

extends Object
implements StringEncoder

Encodes a string into a Caverphone value. This is an algorithm created by the Caversham Project at the University of Otago. It implements the Caverphone 2.0 algorithm:

Since:
  1.5
Version:
  $Id: Caverphone.java 1075947 2011-03-01 17:56:14Z ggregory $
Author:
  Apache Software Foundation
See Also:
  Wikipedia - Caverphone

Constructor Summary
`AbstractCaverphone()` Creates an instance of the Caverphone encoder

Method Summary
`Object` | `encode(Object source)` Encodes an Object using the caverphone algorithm.
`boolean` | `isEncodeEqual(String str1, String str2)` Tests if the encodings of two strings are equal.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Methods inherited from interface org.apache.commons.codec.StringEncoder
`encode`

Constructor Detail

### AbstractCaverphone

    public AbstractCaverphone()

  Creates an instance of the Caverphone encoder

Method Detail

### encode

    public Object encode(Object source)
                  throws EncoderException

  Encodes an Object using the caverphone algorithm. This method is provided in order to satisfy the requirements of the Encoder interface, and will throw an EncoderException if the supplied object is not of type java.lang.String.

  Specified by:
    `encode` in interface `Encoder`
  Parameters:
    `source` - Object to encode
  Returns:
    An object (or type java.lang.String) containing the caverphone code which corresponds to the String supplied.
  Throws:
    `EncoderException` - if the parameter supplied is not of type java.lang.String

### isEncodeEqual

    public boolean isEncodeEqual(String str1,
                                 String str2)
                          throws EncoderException

  Tests if the encodings of two strings are equal. This method might be promoted to a new AbstractStringEncoder superclass.

  Parameters:
    `str1` - First of two strings to compare
    `str2` - Second of two strings to compare
  Returns:
    `true` if the encodings of these strings are identical, `false` otherwise.
  Throws:
    `EncoderException`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2002-2011 The Apache Software Foundation. All Rights Reserved.