package com.jscape.inet.terminal;

/**
 * Represents US ASCII character set. In fact performs no additional encoding
 * of incoming characters.
 * "Singleton" pattern [Gamma94].
 * "Strategy" pattern [Gamma94].
 */
public class USAscii
        implements CharacterSet {

    private static final USAscii INSTANCE = new USAscii();

    //----------------------------------------------------------------------------

    /**
     * Returns one and only one instance of this type.
     *
     * @return one and only one instance of this type.
     */
    public static USAscii getInstance() {
        return INSTANCE;
    }

    //----------------------------------------------------------------------------

    /**
     * Private constructor to prevent uncontrolled creation.
     */
    private USAscii() {
    }

    //----------------------------------------------------------------------------

    /**
     * Encodes giving character.
     *
     * @param ch character to be encoded.
     *
     * @return encoded character.
     */
    public char encode(char ch) {
        return ch;
    }

}
