001/* Base interface for a mirror transformer for graphs.
002
003 Copyright (c) 2003-2005 The University of Maryland. All rights reserved.
004 Permission is hereby granted, without written agreement and without
005 license or royalty fees, to use, copy, modify, and distribute this
006 software and its documentation for any purpose, provided that the above
007 copyright notice and the following two paragraphs appear in all copies
008 of this software.
009
010 IN NO EVENT SHALL THE UNIVERSITY OF MARYLAND BE LIABLE TO ANY PARTY
011 FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
012 ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
013 THE UNIVERSITY OF MARYLAND HAS BEEN ADVISED OF THE POSSIBILITY OF
014 SUCH DAMAGE.
015
016 THE UNIVERSITY OF MARYLAND SPECIFICALLY DISCLAIMS ANY WARRANTIES,
017 INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
018 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE
019 PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF
020 MARYLAND HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES,
021 ENHANCEMENTS, OR MODIFICATIONS.
022
023
024 */
025package ptolemy.graph.analysis.analyzer;
026
027import ptolemy.graph.Graph;
028
029//////////////////////////////////////////////////////////////////////////
030//// MirrorTransformerAnalyzer
031
032/**
033 Base interface for a mirror transformer for graphs.
034 <p>
035 In the {@link #cloneWeight} method, users can also specify whether to clone node
036 and edge weights. For non cloneable
037 weights a {@link java.lang.CloneNotSupportedException} will be thrown by
038 the virtual machine.
039 <p>
040 @since Ptolemy II 4.0
041 @Pt.ProposedRating Red (shahrooz)
042 @Pt.AcceptedRating Red (ssb)
043 @see ptolemy.graph.analysis.MirrorTransformation
044 @author Shahrooz Shahparnia
045 @version $Id$
046 */
047public interface MirrorTransformer extends Transformer {
048    /** Changes the status of the graph returned by the {@link #mirror} method.
049     *  If set to true, the weights will also be cloned in the next calls to the
050     *  {@link #mirror} method.
051     *
052     *  @param status If set to true, the weights will also be cloned.
053     */
054    public void cloneWeight(boolean status);
055
056    /** Create a mirror of the graph associated with this analyzer with the
057     *  same runtime class.
058     *
059     *  @return The resulting mirror graph.
060     */
061    public Graph mirror();
062
063    /** Return a mirror of this graph in the form of the argument graph type
064     *  (i.e., the run-time type of the returned graph is that of the
065     *  argument graph).
066     *  <p>
067     *
068     *  @param graph The type of the graph which the graph associated with
069     *  this analyzer is being mirrored to.
070     *  @param cloneWeights If set true, the weights will also be cloned.
071     *  @return The resulting mirror graph.
072     */
073    public Graph mirror(Graph graph, boolean cloneWeights);
074}