/**
 * Represents ANSI command set in terminal.
 * "Singleton" pattern [Gamma94].
 * "State" pattern [Gamma94].
 */
package com.jscape.inet.terminal;

import com.jscape.inet.terminal.commands.*;

public class VT100Set
        extends CommandSet {

    private static final String NAME = "ANSI";
    private static final VT100Set INSTANCE = new VT100Set();

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

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

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

    /**
     * Private constructor to prevent uncontrolled creation.
     */
    private VT100Set() {
        super(NAME);
        addCommand(CUBCommand.CANONICAL_FORM, CUBCommand.getInstance());
        addCommand(CUDCommand.CANONICAL_FORM, CUBCommand.getInstance());
        addCommand(CUFCommand.CANONICAL_FORM, CUFCommand.getInstance());
        addCommand(CUPCommand.CANONICAL_FORM, CUPCommand.getInstance());
        addCommand(CUUCommand.CANONICAL_FORM, CUUCommand.getInstance());
        addCommand(SGRCommand.CANONICAL_FORM, SGRCommand.getInstance());
        addCommand(ELCommand.CANONICAL_FORM, ELCommand.getInstance());
        addCommand(EDCommand.CANONICAL_FORM, EDCommand.getInstance());
        addCommand(SCSG0BCommand.CANONICAL_FORM, SCSG0BCommand.getInstance());
        addCommand(SCSG1BCommand.CANONICAL_FORM, SCSG1BCommand.getInstance());
        addCommand(SCSG00Command.CANONICAL_FORM, SCSG00Command.getInstance());
        addCommand(SCSG10Command.CANONICAL_FORM, SCSG10Command.getInstance());
        addCommand(DACommand.CANONICAL_FORM, DACommand.getInstance());
        addCommand(HTSCommand.CANONICAL_FORM, HTSCommand.getInstance());
        addCommand("\033[f", CUPCommand.getInstance());
        addCommand(INDCommand.CANONICAL_FORM, INDCommand.getInstance());
        addCommand(NELCommand.CANONICAL_FORM, NELCommand.getInstance());
        addCommand(RICommand.CANONICAL_FORM, RICommand.getInstance());
        addCommand(TBCCommand.CANONICAL_FORM, TBCCommand.getInstance());
        addCommand(DSRCommand.CANONICAL_FORM, DSRCommand.getInstance());
        addCommand(DECIDCommand.CANONICAL_FORM, DECIDCommand.getInstance());
        addCommand(DECTSTCommand.CANONICAL_FORM, DECTSTCommand.getInstance());
        addCommand(SMCommand.CANONICAL_FORM, SMCommand.getInstance());
        addCommand(RMCommand.CANONICAL_FORM, RMCommand.getInstance());
        addCommand(DECSTBMCommand.CANONICAL_FORM, DECSTBMCommand.getInstance());
    }

}