/**
 * A simple counter
 * @author Mark Stehlik
 */

public class Counter
{
    private int myCount;

    /**
     * Construct a counter whose value is zero
     */
    public Counter()
    {
		myCount = 0;
    }
    
    /**
     * Construct a counter whose start value is provided
     * @param the counter's initial value
     */
    public Counter(int start)
    {
		myCount = start;
    }

    /**
     * Returns the value of the counter.
     * @return the value of the counter
     */
    public int getValue()
    {
		return myCount;
    }

    /**
     * Zeros the counter so getValue() == 0.
     */
    public void clear()
    {
		myCount = 0;
    }

    /**
     * Increase the value of the counter by one.
     */
    public void increment()
    {
		myCount++;
    }

    /**
     * Return a string representing the value of this counter.
     */
    public String toString()
    {
		return "" + myCount;
    }
}
