/*
 * Delivered to the U.S. Government in Accordance with Contract FA8650-10-C-7080.
 *
 * EXPORT CONTROLLED
 * ECCN#   EAR99
 * Warning:  This document contains technical data which is controlled under the
 * Bureau of Industry & Security's Export Administration Regulations and may not be
 * exported or re-exported without authorization by the Bureau of Industry & Security.
 * Diversion contrary to US law is prohibited.
 *
 * (c) 2011 United Technologies Corp.
 * Developed with the sponsorship of the Defense Advanced Research Projects Agency (DARPA).
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy of this data,
 * including any software or models in source or binary form, as well as any drawings, 
 * specifications, and documentation (collectively "the Data"), to deal in the Data without 
 * restriction, including without limitation the rights to use, copy, modify, merge, publish,
 * distribute, sublicense, and/or sell copies of the Data, and to permit persons to whom the Data
 * 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 Data.
 *
 * THE DATA 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, SPONSORS, DEVELOPERS, CONTRIBUTORS, 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 DATA OR THE
 * USE OR OTHER DEALINGS IN THE DATA.
 */

package meta.model;

import java.util.List;

import meta.util.Export;

import org.jgrapht.graph.DefaultEdge;
import org.jgrapht.graph.SimpleDirectedGraph;
/**
 *  An API to query an design architecture. 
 *  One can obtain devices, flows, and links.
 */
public interface Architecture {
   /* gaspath flow index */
   public static final int GAS = 1;
   /* mechanical flow index */
   public static final int 	MECHANICAL = 2;
   /* bleed flow index */
   public static final int 	BLEED = 3;
	/**
	 * Obtain a device, given a device id
	 */	
	public abstract Device getDevice(int id);
	/**
	 * Obtain a flow, given a flow id
	 */	
	public abstract Flow getFlow(int id);
	/**
	 * Report the device indexes
	 */
	public abstract int[] getDeviceIndexes();

	/**
	 * Report all possible device names 
	 */
	public abstract String[] getDeviceNames();
	/**
	 * Report a List of Devices that are only present in the architecture 
	 * (not all possible devices)
	 */
	public List<Device> getDevices();
	/**
	 * Report the number of devices
	 */
	public int getNumberOfDevices();
	/**
	 * Report the flow names
	 */
	public abstract String[] getFlowNames();

	/**
	 * Report the flow indexes
	 */
	public abstract int[] getFlowIndexes();

	/**
	 * Report the flow type indexes from the link table
	 */
	public abstract int[] getFlowTypeIndexes();

	/**
	 * Report the source (origin) device from the link table
	 */
	public abstract int[] getSourceIndexes();

	/**
	 * Report the sink (destination) device from the link table
	 */
	public abstract int[] getSinkIndexes();
	/**
	 * Report the link table
	 */
	public abstract List<Link> getLinkTable();
	/**
	 * Report the flow table
	 */
	public abstract List<Flow> getFlowTable();

    /**
     * Return a graph containing components with the requested flow type
     */
	public abstract SimpleDirectedGraph<String, DefaultEdge> getGraph(int flowType);
	/**
	 * Export the architecture to XMI 
	 */
	public abstract void toXMI();
	/**
	 * Report the architecture name
	 */
	public String getName();
	/**
	 * Reports if the engine is embedded.
	 */
	public boolean isEngineEmbedded();
	/**
	 * Reports if the engine has a prop in the back
	 */
	public boolean hasRearProp();
	/**
	 * Report the node table used for output
	 * @see ExportResults
	 */
	public List<String> getNodeTable();
	/**
	 * Report Engine Type
	 */
	public String getEngineType();
}
