Class NameDuplicationException

  • All Implemented Interfaces:
    java.io.Serializable

    public class NameDuplicationException
    extends KernelException
    Thrown on an attempt to add a named object to a collection that requires unique names, and finding that there already is an object by that name in the collection. Constructors are provided that take 1 or 2 Nameable references plus an arbitrary String. The constructors are robust in that null references are ignored. The preferred constructors are those that take two named objects (the container and the would-be containee), or two named objects and an arbitrary string (which can be used to provide additional information about the error).

    This class has no constructors that take a Throwable cause because no such constructors have been needed, but in principle, such constructors could be added if needed.

    Since:
    Ptolemy II 0.2
    Version:
    $Id$
    Author:
    John S. Davis II, Edward A. Lee, Christopher Hylands
    See Also:
    Serialized Form
    Pt.AcceptedRating:
    Green (cxh)
    Pt.ProposedRating:
    Green (cxh)
    • Constructor Detail

      • NameDuplicationException

        public NameDuplicationException​(Nameable container,
                                        java.lang.String detail)
        Construct an exception with a detail message that includes the name of the first argument. If one or more of the parameters are null, then the message of the exception is adjusted accordingly.
        Parameters:
        container - The would be container.
        detail - The message.
      • NameDuplicationException

        public NameDuplicationException​(Nameable container,
                                        Nameable wouldBeContainee)
        Construct an exception with a message that includes the name of the would be containee and the would be container. If one or more of the parameters are null, then the message of the exception is adjusted accordingly.
        Parameters:
        wouldBeContainee - The would be containee.
        container - The would be container.
      • NameDuplicationException

        public NameDuplicationException​(Nameable container,
                                        Nameable wouldBeContainee,
                                        java.lang.String detail)
        Construct an exception with a detail message that includes the name of the would be containee and the would be container plus the third argument string. If one or more of the parameters are null, then the message of the exception is adjusted accordingly.
        Parameters:
        wouldBeContainee - The would be containee.
        container - The would be container.
        detail - A message.