package de.uka.ipd.consensus.foundation.schema;

import java.io.Serializable;

import de.uka.ipd.consensus.foundation.ontology.OntologyManagerException;
import de.uka.ipd.consensus.foundation.rights.DynamicRightsManagerException;

/**
 * This is the superinterface of the main elements of the ontology: topics, associations and attributes.
 * @author Thomas Much
 * @version 2006-06-14
 */
public interface Concept extends Versionable,Commentatable,Rateable,Createable,Serializable,Comparable {

	/**
	 * Returns the concept's unique id that was either computed automatically or given explicitely at creation time.
	 * @return the id (never empty, never <code>null</code>)
	 * @see de.uka.ipd.consensus.foundation.ontology.OntologyManager#createTopic(User, String, String, Topic)
	 * @see de.uka.ipd.consensus.foundation.ontology.OntologyManager#createAssociation(User, String, String, Topic)
	 * @see de.uka.ipd.consensus.foundation.ontology.OntologyManager#createAttribute(User, String, String, String, Topic)
	 */
	public String getId();

	
	/**
	 * Returns the concept's name.
	 * @return the name of the concept (may be the empty string, but never <code>null</code>)
	 */
	public String getName();
	
	
	/**
	 * Changes the concept's name.
	 * @param setter the user who wants to change the name
	 * @param name the new name
	 * @throws OntologyManagerException if the name could not be changed
	 * @throws DynamicRightsManagerException if the user is not allowed to change the name
	 */
	public void setName(User setter, String name) throws OntologyManagerException,DynamicRightsManagerException;

	
	/**
	 * Checks if this concept is of the given type.
	 * @param type the type topic,  including <code>null</code> for typeless concepts
	 * @return <code>true</code> if the concept is of the specified type, <code>false</code> otherwise
	 */
	public boolean isOfType(Topic type);

}
