Class TestNullNamedObj

    • Constructor Detail

      • TestNullNamedObj

        public TestNullNamedObj()
                         throws IllegalActionException
        Construct an object in the default workspace with an empty string as its name. The object is added to the list of objects in the workspace. Increment the version number of the workspace.
        Throws:
        IllegalActionException - Not thrown.
      • TestNullNamedObj

        public TestNullNamedObj​(java.lang.String name)
                         throws IllegalActionException
        Construct an object in the default workspace with an empty string as its name. The object is added to the list of objects in the workspace. Increment the version number of the workspace.
        Throws:
        IllegalActionException - If the name has a period.
    • Method Detail

      • getContainedObject

        public NamedObj getContainedObject​(NamedObj container,
                                           java.lang.String relativeName)
                                    throws IllegalActionException
        Get an object with the specified name in the specified container. The type of object sought is an instance of the same class as this object. In this base class, return null, as there is no containment mechanism. Derived classes should override this method to return an object of their same type.
        Parameters:
        relativeName - The name relative to the container.
        container - The container expected to contain the object.
        Returns:
        null.
        Throws:
        IllegalActionException - If the object exists and has the wrong class. Not thrown in this base class.
      • getName

        public java.lang.String getName()
        Get the name. If no name has been given, or null has been given, then return an empty string, "".
        Specified by:
        getName in interface Nameable
        Overrides:
        getName in class NamedObj
        Returns:
        The name of the object.
        See Also:
        NamedObj.setName(String)