src/test/java/MorseCodeDecoderVerbose.java
/**
     * Decode a String of Morse Code into uppercase readable String.
     *
     * @param morseCode a String of '.', '-' and ' ' characters
     * @return readable String
     */
Decode a String of Morse Code into uppercase readable String.
Decode a String of Morse Code into uppercase readable String .
public static String decode(String morseCode) {
        StringBuilder message = new StringBuilder();
        MorseCodeDecoderVerbose decoder = new MorseCodeDecoderVerbose(morseCode);
        while (decoder.more()){
            String code = decoder.getCode();
            message.append(MorseCode.get(code));
            int gap = decoder.skipSpace();
            if (gap > 1)
                message.append(" ");
        }
        return message.toString();
    }
public static String decode ( String morseCode ) { StringBuilder message = new StringBuilder ( ) ; MorseCodeDecoderVerbose decoder = new MorseCodeDecoderVerbose ( morseCode ) ; while ( decoder . more ( ) ) { String code = decoder . getCode ( ) ; message . append ( MorseCode . get ( code ) ) ; int gap = decoder . skipSpace ( ) ; if ( gap > 1 ) message . append ( " " ) ; } return message . toString ( ) ; }
Decode a String of Morse Code into uppercase readable String.
Decode a String of Morse Code into uppercase readable String .