1 package cz.cuni.amis.pogamut.sposh.elements; 2 3 import cz.cuni.amis.pogamut.sposh.exceptions.CycleException; 4 import cz.cuni.amis.pogamut.sposh.exceptions.DuplicateNameException; 5 import cz.cuni.amis.pogamut.sposh.exceptions.InvalidNameException; 6 7 /** 8 * Interface for lap elements with name. Most of the elements have a name, but 9 * some (e.g. {@link Goal)) don't. 10 * 11 * @author HonzaH 12 */ 13 public interface INamedElement { 14 15 /** 16 * Get name of the element. The actual name, not display name (e.g. action 17 * can have FQN of class, but display name would be derived fromk 18 * annotations of the class) or representation (e.g. sense name "health" is 19 * different from actual condition of sense "health > 90"). 20 * 21 * @return Name of the element 22 */ 23 public String getName(); 24 25 /** 26 * Change name of the element to newName. Renaming doesn't just change name, 27 * it also changes all references in the plan from the old name to a new 28 * one. 29 * 30 * @param newName New name of the element. 31 * @throws InvalidNameException Passed name is not valid Yaposh name. 32 * @throws CycleException Renaming causes cycle. 33 * @throws DuplicateNameException Such name is already used in the plan. 34 */ 35 public void rename(String newName) throws InvalidNameException, CycleException, DuplicateNameException; 36 }