package CH.ifa.draw.framework;

import de.renew.draw.storables.ontology.Figure;

/**
 * Figures providing identification by an ID.
 * <p>
 * The ID should be persistent until changed explicitly
 * by setID(). Instances should default to NOID until
 * setID() is called the first time, unless the Constructor
 * sets the ID explicitly.
 * <p>
 * Be careful not to use the NOID value as an ID to
 * avoid confusion. Uniqueness of IDs is not guaranteed,
 * it lies in the responsibility of the assigning instance.
 * </p><p>
 * The only known class (at the time this comment was written)
 * which makes use of IDs is <code>de.renew.gui.CPNDrawing</code>.
 * <p>
 * An analogous concept is used to identify shadow net
 * elements (package <code>de.renew.shadow</code>). If the
 * internal representation of NOID is the same in both
 * identification schemes, the mapping will be easier.
 * </p>
 *
 * FigureWithID.java
 * Created: Tue Mar 14  2000
 *
 * @author Michael Duvigneau
 **/
public interface FigureWithID extends Figure {

    /**
     * See interface description for details.
     * Currently represented as 0.
     **/
    int NOID = 0;

    /**
     * Sets the ID of this figure.
     * @param id identification of figure as int
     */
    void setID(int id);

    /**
     * Gets the ID of this figure.
     * @return id of figure
     */
    int getID();
}