/*
 *	EasyScout Boy Scouts of America tracking software.
 *	http://www.easyscout.org/
 *
 *	Copyright (C) 2000 Conan C. Albrecht
 *	conan@warp.cx
 *
 *	This program is released under the GNU license so tech-savvy
 *	Boy Scouts and others can enhance the program for the use
 *	of all.  Please e-mail changes to my address above so I can
 *	reintegrate into the main program at http://www.easyscout.org/.
 *	This way, all users mutually benefit one another in the spirit of
 *	scouting.
 *
 *	This program is free software; you can redistribute it and/or
 *	modify it under the terms of the GNU General Public License
 *	as published by the Free Software Foundation; either version 2
 *	of the License, or (at your option) any later version.
 *
 * 	Any and all changes to the program code must be documented with
 *  date, author name and e-mail, and a short description.
 *
 *	This program is distributed in the hope that it will be useful,
 *	but WITHOUT ANY WARRANTY; without even the implied warranty of
 *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *	GNU General Public License for more details.
 *
 *	You should have received a copy of the GNU General Public License
 *	along with this program; if not, write to the Free Software
 *	Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 */

package cx.warp.scout.file;

import cx.warp.scout.*;
import java.util.*;
import java.io.*;

/** A leadership position in the troop */
public class FilePosition implements cx.warp.scout.Position, java.io.Serializable, Identifiable {

	public static final long serialVersionUID = 8963348229808083784L;
	
	protected FileScout scout = null;
	protected String id = Utils.getGUID();
	protected String name;
	protected Date startDate = null;
	protected Date endDate = null;
	
	/** Constructor */
	public FilePosition(FileScout scout) {
		this.scout = scout;
	}//constructor
	
	/** Returns the id */
	public String getID()  throws DataException{
		return id;
	}//getID
	
	/** Sets the position name */
	public void setName(String name) throws DataException {
		this.name = name;
	}//setName
	
	/** Returns the position name */
	public String getName() throws DataException {
		return name;
	}//getname
	
	/** Sets the start date of a position */
	public void setStartDate(Date start) throws DataException {
		this.startDate = start;
	}//setStartDate
	
	/** Returns the position start date */
	public Date getStartDate() throws DataException {
		return startDate;
	}//getStartDate
	
	/** Sets the position end date */
	public void setEndDate(Date end) throws DataException {
		this.endDate = end;
	}//setEndDate
	
	/** Returns the position end date */
	public Date getEndDate() throws DataException {
		return endDate;
	}//getEndDate
	
	/** Writes my information to an XML buffer */
	public void writeXML(PrintWriter out) throws DataException {
		out.println("    <Leadership id=\"" + id + "\">");
		out.println("      <Name>" + Utils.xml(name) + "</Name>");
		out.println("      <Start>" + Utils.xml(startDate) + "</Start>");
		out.println("      <End>" + Utils.xml(endDate) + "</End>");
		out.println("    </Leadership>");
	}//writeXML

}//Position
