Class DoubleMetaphone.DoubleMetaphoneResult

  • Enclosing class:
    DoubleMetaphone

    public class DoubleMetaphone.DoubleMetaphoneResult
    extends java.lang.Object
    Stores results, since there is the optional alternate encoding.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.StringBuilder alternate  
      private int maxLength  
      private java.lang.StringBuilder primary  
    • Constructor Summary

      Constructors 
      Constructor Description
      DoubleMetaphoneResult​(int maxLength)
      Constructs a new instance.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void append​(char value)
      Appends the given value as primary and alternative.
      void append​(char primary, char alternate)
      Appends the given primary and alternative values.
      void append​(java.lang.String value)
      Appends the given value as primary and alternative.
      void append​(java.lang.String primary, java.lang.String alternate)
      Appends the given primary and alternative values.
      void appendAlternate​(char value)
      Appends the given value as alternative.
      void appendAlternate​(java.lang.String value)
      Appends the given value as alternative.
      void appendPrimary​(char value)
      Appends the given value as primary.
      void appendPrimary​(java.lang.String value)
      Appends the given value as primary.
      java.lang.String getAlternate()
      Gets the alternate string.
      java.lang.String getPrimary()
      Gets the primary string.
      boolean isComplete()
      Tests whether this result is complete.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • primary

        private final java.lang.StringBuilder primary
      • alternate

        private final java.lang.StringBuilder alternate
      • maxLength

        private final int maxLength
    • Constructor Detail

      • DoubleMetaphoneResult

        public DoubleMetaphoneResult​(int maxLength)
        Constructs a new instance.
        Parameters:
        maxLength - The maximum length.
    • Method Detail

      • append

        public void append​(char value)
        Appends the given value as primary and alternative.
        Parameters:
        value - The value to append.
      • append

        public void append​(char primary,
                           char alternate)
        Appends the given primary and alternative values.
        Parameters:
        primary - The primary value.
        alternate - The alternate value.
      • append

        public void append​(java.lang.String value)
        Appends the given value as primary and alternative.
        Parameters:
        value - The value to append.
      • append

        public void append​(java.lang.String primary,
                           java.lang.String alternate)
        Appends the given primary and alternative values.
        Parameters:
        primary - The primary value.
        alternate - The alternate value.
      • appendAlternate

        public void appendAlternate​(char value)
        Appends the given value as alternative.
        Parameters:
        value - The value to append.
      • appendAlternate

        public void appendAlternate​(java.lang.String value)
        Appends the given value as alternative.
        Parameters:
        value - The value to append.
      • appendPrimary

        public void appendPrimary​(char value)
        Appends the given value as primary.
        Parameters:
        value - The value to append.
      • appendPrimary

        public void appendPrimary​(java.lang.String value)
        Appends the given value as primary.
        Parameters:
        value - The value to append.
      • getAlternate

        public java.lang.String getAlternate()
        Gets the alternate string.
        Returns:
        the alternate string.
      • getPrimary

        public java.lang.String getPrimary()
        Gets the primary string.
        Returns:
        the primary string.
      • isComplete

        public boolean isComplete()
        Tests whether this result is complete.
        Returns:
        whether this result is complete.