/*
 *	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;

import java.util.*;
import java.io.*;

/** The main interface to a troop */
public interface Troop extends Identifiable {
	
	/** Explicitly saves a troop */
	public void save() throws DataException;

	/** Sets the troop name */
	public void setName(String name) throws DataException ;
	
	/** Returns the troop name */
	public String getName() throws DataException ;
	
	/** Sets the troop password */
	public void setPassword(String pass) throws DataException ;
	
	/** Verifies whether the given password matches the troop password */
	public boolean verifyPassword(String pass) throws DataException ;
	
	/** Returns the troop password */
	public String getPassword() throws DataException;
	
	/** Sets the troop read-only password */
	public void setReadPassword(String pass) throws DataException;

	/** Returns the troop read-only password */
	public String getReadPassword() throws DataException;
	
	/** Sets the owner name */
	public void setOwner(String owner) throws DataException;
	
	/** Gets the owner name */
	public String getOwner() throws DataException;
	
	/** Sets the owner e-mail */
	public void setEmail(String email) throws DataException;
	
	/** Returns the owner e-mail */
	public String getEmail() throws DataException;
	
	/** Writes the contents of this Troop to an XML buffer */
	public void writeXML(PrintWriter out) throws DataException;
	
	/////////////////////////
	///   Scout methods   ///
	/////////////////////////
	
	/** Creates a new scout */
	public Scout createScout(String version) throws DataException;
	
	/** Returns the scout with the given id */
	public Scout getScout(String id) throws DataException ;
		
	/** Returns an enumeration of the scouts in this troop */
	public Enumeration getScouts() throws DataException ;
	
	/** Returns an enumeration of this scouts in this troop, sorted by the given getter method. */
	public Enumeration getScouts(String getterMethod) throws DataException ;
	
	/** Returns the number of scouts in the troop */
	public int getScoutCount() throws DataException;
	
	/** Deletes a scout from the list */
	public boolean deleteScout(String id) throws DataException;
	
	//////////////////////////
	///   Leader methods   ///
	//////////////////////////
	
	/** Creates a new leader */
	public Leader createLeader() throws DataException;
	
	/** Returns the leader with the given id */
	public Leader getLeader(String id) throws DataException;
	
	/** Returns an enumeration of the leaders in this troop */
	public Enumeration getLeaders() throws DataException;
	
	/** Returns the number of leaders in the troop */
	public int getLeaderCount() throws DataException;
	
	/** Deletes a leader from the list */
	public boolean deleteLeader(String id) throws DataException;

}//Troop
