package org.ajax4jsf.bean.tree.swing;

import org.richfaces.model.SwingTreeNodeImpl;

public class Album extends SwingTreeNodeImpl {

    private String title;
    private Integer year;

    /**
     * Gets value of title field.
     * @return value of title field
     */
    public String getTitle() {
        return title;
    }

    /**
     * Set a new value for title field.
     * @param title a new value for title field
     */
    public void setTitle(String title) {
        this.title = title;
    }

    /**
     * Gets value of year field.
     * @return value of year field
     */
    public Integer getYear() {
        return year;
    }

    /**
     * Set a new value for year field.
     * @param year a new value for year field
     */
    public void setYear(Integer year) {
        this.year = year;
    }

    public void addSong(Song song) {
        addChild(song);
        song.setParent(this);
    }

    /**
     * Gets value of performer field.
     * @return value of performer field
     */
    public Performer getPerformer() {
        return (Performer) getParent();
    }

    /**
     * Set a new value for performer field.
     * @param performer a new value for performer field
     */
    public void setPerformer(Performer performer) {
        setParent(performer);
    }

    public String getType() {
        return "album";
    }
}
