package com.jscape.inet.terminal;

/**
 * Base interfase for control sequence types.
 * "Strategy" pattern [Gamma94].
 */
public interface SequenceType {

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

    /**
     * Checks if sequence is complete.
     *
     * @param value sequence value.
     *
     * @return true if sequence is complete.
     */
    boolean isComplete(StringBuffer value);

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

    /**
     * Extracts and returns sequence parameters as array of <code>int</code>.
     *
     * @param value sequence value.
     *
     * @return array of <code>int</code>.
     */
    int[] getParameters(StringBuffer value);

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

    /**
     * Returns "canonical" form of control sequence (i.e. without parameters).
     *
     * @param value sequence value.
     *
     * @return string with "canonical" sequence form.
     */
    String getCanonicalForm(StringBuffer value);

}