/*******************************************************************************
* Copyright (c)                                                                *
*           2005   Tristan Allwood,                                            *
*           2005   Daniel Burke,                                               *
*           2005   Marc Hull,                                                  *
*           2005   Ekaterina Itskova,                                          *
*           2005   Steve Zymler                                                *
*                                                                              *
* Permission is hereby granted, free of charge, to any person obtaining a      *
* copy of this software and associated documentation files (the                *
* "Software"), to deal in the Software without restriction, including          *
* without limitation the rights to use, copy, modify, merge, publish,          *
* distribute, sublicense, and/or sell copies of the Software, and to           *
* permit persons to whom the Software is furnished to do so, subject to        *
* the following conditions:                                                    *
*                                                                              *
* The above copyright notice and this permission notice shall be included      *
* in all copies or substantial portions of the Software.                       *
*                                                                              *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS      *
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF                   *
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.       *
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY         *
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,         *
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE            *
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.                       *
*******************************************************************************/
/*
 * Created on 19-Oct-2004
 *
 */
package uk.ac.ic.doc.kevlar.api.programs.arguments;

import java.util.Map;

/**
 * Represents a list of argument->Value assignments as a map.
 * Three uses
 * - Used to calculate list of available arguments
 * - Used to calculate IO nodes
 * - Passed to programs on execution.
 * @author Daniel Burke
 *
 */
public interface IArgumentInstance {
	
    /**
     * @return the map of argument names to their values
     */
	public Map<String, IBasicArgumentValue> getAssigmentsMap();
	
	/**
	 * Write XML of instance out to text
	 * @param text
	 * @param depth
	 */
	public void putInstance(StringBuilder text, int depth);
	
	/**
	 * 
	 * @param argName the argument name to test
	 * @return true iff the arguments has this argument name set to a value
	 */
	public boolean has(String argName);
	
	/**
	 * 
	 * @param argName the argument name to get the value of
	 * @return the argument value associated with the argName or null if a value hasn't been set
	 */
	public IBasicArgumentValue get(String argName);
	
	/**
	 *
	 * @param argName the argument name to get the value of
	 * @return the boolean value associated with the argument or null if there isn't one
	 * @throws IllegalArgumentException if the value associated with argName is not a Boolean value
	 */
	public Boolean getBool(String argName);
	
	/**
	 *
	 * @param argName the argument name to get the value of
	 * @return the text value associated with the argument or null if there isn't one
	 * @throws IllegalArgumentException if the value associated with argName is not a Text value
	 */
	public String getText(String argName);
	
	/**
	 *
	 * @param argName the argument name to get the value of
	 * 	 * @return the set value associated with the argument or null if there isn't one
	 * @throws IllegalArgumentException if the value associated with argName is not a Set Value
	 */
	public String getSetValue(String argName);
}
