package semorg.gui.util;

import java.util.HashSet;
import java.util.Set;

/** This class is unused...  */
public class EditorManager {

    /** Set of the ids whose corresponding objects are edited. */
    private Set<Integer> ids = new HashSet<Integer>();

    /**
     * Add the given id to the {@link #ids} {@link HashSet}.
     * 
     * @param id
     *                the id to add
     */
    public void addEditingId(int id) {
	ids.add(new Integer(id));
    }

    /**
     * Removes the given id from the {@link #ids} {@link HashSet}.
     * 
     * @param id
     *                the id to add
     */

    public void removeEditingId(int id) {
	ids.remove(new Integer(id));
    }

    /**
     * Checks if the object to the given id is already edited.
     * 
     * @param id
     *                id to check.
     * @return <tt>true</tt> if the given id is contained in {@link #ids},
     *         <tt>false</tt> otherwise.
     */
    public boolean isEditing(int id) {
	return ids.contains(new Integer(id));
    }

}
