Class DoubleMetaphone

    • Constructor Summary

      Constructors 
      Constructor Description
      DoubleMetaphone()
      Constructs a new instance.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String doubleMetaphone​(java.lang.String value)
      Encodes a value with Double Metaphone.
      java.lang.String doubleMetaphone​(java.lang.String value, boolean alternate)
      Encodes a value with Double Metaphone, optionally using the alternate encoding.
      java.lang.Object encode​(java.lang.Object obj)
      Encodes the value using DoubleMetaphone.
      java.lang.String encode​(java.lang.String value)
      Encodes the value using DoubleMetaphone.
      int getMaxCodeLen()
      Gets the maxCodeLen.
      boolean isDoubleMetaphoneEqual​(java.lang.String value1, java.lang.String value2)
      Tests whether the Double Metaphone values of two String values are equal.
      boolean isDoubleMetaphoneEqual​(java.lang.String value1, java.lang.String value2, boolean alternate)
      Tests whether the Double Metaphone values of two String values are equal, optionally using the alternate value.
      void setMaxCodeLen​(int maxCodeLen)
      Sets the maxCodeLen.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DoubleMetaphone

        public DoubleMetaphone()
        Constructs a new instance.
    • Method Detail

      • doubleMetaphone

        public java.lang.String doubleMetaphone​(java.lang.String value)
        Encodes a value with Double Metaphone.
        Parameters:
        value - String to encode.
        Returns:
        an encoded string.
      • doubleMetaphone

        public java.lang.String doubleMetaphone​(java.lang.String value,
                                                boolean alternate)
        Encodes a value with Double Metaphone, optionally using the alternate encoding.
        Parameters:
        value - String to encode.
        alternate - use alternate encode.
        Returns:
        an encoded string.
      • encode

        public java.lang.Object encode​(java.lang.Object obj)
                                throws EncoderException
        Encodes the value using DoubleMetaphone. It will only work if obj is a String (like Metaphone).
        Specified by:
        encode in interface Encoder
        Parameters:
        obj - Object to encode (should be of type String).
        Returns:
        An encoded Object (will be of type String).
        Throws:
        EncoderException - encode parameter is not of type String.
      • encode

        public java.lang.String encode​(java.lang.String value)
        Encodes the value using DoubleMetaphone.
        Specified by:
        encode in interface StringEncoder
        Parameters:
        value - String to encode.
        Returns:
        An encoded String.
      • getMaxCodeLen

        public int getMaxCodeLen()
        Gets the maxCodeLen.
        Returns:
        the maxCodeLen.
      • isDoubleMetaphoneEqual

        public boolean isDoubleMetaphoneEqual​(java.lang.String value1,
                                              java.lang.String value2)
        Tests whether the Double Metaphone values of two String values are equal.
        Parameters:
        value1 - The left-hand side of the encoded String.equals(Object).
        value2 - The right-hand side of the encoded String.equals(Object).
        Returns:
        true if the encoded Strings are equal; false otherwise.
        See Also:
        isDoubleMetaphoneEqual(String,String,boolean)
      • isDoubleMetaphoneEqual

        public boolean isDoubleMetaphoneEqual​(java.lang.String value1,
                                              java.lang.String value2,
                                              boolean alternate)
        Tests whether the Double Metaphone values of two String values are equal, optionally using the alternate value.
        Parameters:
        value1 - The left-hand side of the encoded String.equals(Object).
        value2 - The right-hand side of the encoded String.equals(Object).
        alternate - use the alternate value if true.
        Returns:
        true if the encoded Strings are equal; false otherwise.
      • setMaxCodeLen

        public void setMaxCodeLen​(int maxCodeLen)
        Sets the maxCodeLen.
        Parameters:
        maxCodeLen - The maxCodeLen to set.