import java.util.*;

/**
 * Set up the input vector with the input area
 * 
 * @author Nobo Komagata 
 * @version 5/30/03
 */
public class Input extends Vector
{
    /**
     * Constructor for objects of class Input
     */
    public Input(String inputString) {
        StringTokenizer tok = new StringTokenizer(inputString);

        while (tok.countTokens() > 0) {
            String symbol = tok.nextToken();
            add(symbol);
        }
    }

    /**
     * Find the size of the input vector
     * 
     * @param       None
     * @return      Input vector size
     */
    public int length() {
        return super.size();
    }
    
    /**
     * Find the string at the specified position
     * 
     * @param       Position (0-indexed)
     * @return      String at the position 
     */
    public String at(int i) {
        return (String) super.elementAt(i);
    }
    
    /**
     * Add a string at the end of the input vector
     * 
     * @param       String
     * @return      void 
     */
    public void add(String s) {
        super.addElement(s);
    }
    
    /**
     * Remove the string at the specified position
     * 
     * @param       Position (0-indexed)
     * @return      void 
     */
    public void removeAt(int i) {
        super.removeElementAt(i);
    }
    
    /**
     * Return the string representation of the input vector
     * 
     * @param       None
     * @return      String representation 
     */
    public String toStringPlain() {
        String tmp = "";

        for (int i = 0; i < super.size(); ++i) {
            tmp += (super.elementAt(i) + " ");
        }
        return tmp;
    }
}

