com.dlsc.flexgantt.util

## Class NamedObject

- java.lang.Object
- - com.dlsc.flexgantt.util.NamedObject

- All Implemented Interfaces:
    INamedObject, Comparable<INamedObject>
  Direct Known Subclasses:
    Layer, Page, TreeTableColumn

      public class NamedObject
      extends Object
      implements INamedObject

  A named object is a simple object that only carries a name attribute. As this is a very common attribute it makes sense to create a separate class for it so that it can be used as a superclass for various other types.
  Since:
    1.0
  Author:
    Dirk Lemmermann

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `PROPERTY_NAME` Constant used for those property change events that get triggered when the name of the object gets changed.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `NamedObject()` Constructs a new named object.
    `NamedObject(String name)` Constructs a new named object with the given name.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addPropertyChangeListener(PropertyChangeListener l)` Adds a property change listener to the named object.
    `int` | `compareTo(INamedObject o)`
    `protected PropertyChangeSupport` | `getChangeSupport()` Returns the property change support object so that subclasses can use it to fire property change events.
    `String` | `getName()` Returns the value of the object's name attribute (the object's name).
    `void` | `removePropertyChangeListener(PropertyChangeListener l)` Removes a property change listener from the named object.
    `void` | `setName(String name)` Assigns a new name to the object.
    `String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### PROPERTY_NAME

          public static final String PROPERTY_NAME

      Constant used for those property change events that get triggered when the name of the object gets changed.
      Since:
        1.0
      See Also:
        `setName(String)`, `addPropertyChangeListener(PropertyChangeListener)`, Constant Field Values

  - ### Constructor Detail

    - #### NamedObject

          public NamedObject(String name)

      Constructs a new named object with the given name.
      Parameters:
        `name` - the object's name
      Since:
        1.0

    - #### NamedObject

          public NamedObject()

      Constructs a new named object.
      Since:
        1.0
      See Also:
        `setName(String)`

  - ### Method Detail

    - #### setName

          public void setName(String name)

      Assigns a new name to the object.
      Parameters:
        `name` - the new object name
      Since:
        1.0
      See Also:
        `getName()`

    - #### getName

          public String getName()

      Description copied from interface: `INamedObject`
      Returns the value of the object's name attribute (the object's name).
      Specified by:
        `getName` in interface `INamedObject`
      Returns:
        the object's name

    - #### addPropertyChangeListener

          public void addPropertyChangeListener(PropertyChangeListener l)

      Adds a property change listener to the named object. The listener will be informed if the object's name changes.
      Parameters:
        `l` - the new listener
      Since:
        1.0
      See Also:
        `removePropertyChangeListener(PropertyChangeListener)`

    - #### removePropertyChangeListener

          public void removePropertyChangeListener(PropertyChangeListener l)

      Removes a property change listener from the named object.
      Parameters:
        `l` - the listener that will be removed
      Since:
        1.0
      See Also:
        `addPropertyChangeListener(PropertyChangeListener)`

    - #### getChangeSupport

          protected PropertyChangeSupport getChangeSupport()

      Returns the property change support object so that subclasses can use it to fire property change events.
      Returns:
        the property change support object
      Since:
        1.0

    - #### compareTo

          public int compareTo(INamedObject o)

      Specified by:
        `compareTo` in interface `Comparable<INamedObject>`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

Copyright © 2006–2020 Dirk Lemmermann Software & Consulting. All rights reserved.