package caltool.model.schedule;

import mvp.*;

/****
 *
 * A Category has a Name and StandardColor, which serve to distinguish it from
 * other categories.  Colored-coded categories serve as visual cues to the user
 * when viewing lists of scheduled items in some form.  Categories can also be
 * used in filtered viewing.
 *
 */

public class Category extends Model {

    /**
     * Construct an empty category.
     */
    public Category() {
    }


    /**
     * Construct a category of the given name.  The color is determined by
     * asking the Catgories class for the color assignment of the given
     * cateogories name.
     */
    public Category(String name) {
        this.name = name;
        color = Categories.getColor(name);
    }


    /**
     * Return the string representation of this.  Current implementation does
     * not do color.
     */
    public String toString() {
        return name;
    }


    /*-*
     * Derived data fields
     */

    /** Text name of the category */
    String name;

    /** Color name of the category */
    StandardColor color;

}