bdi4jade.goal

## Class NamedSoftgoal

- java.lang.Object
- - bdi4jade.core.MetadataElementImpl
  - - bdi4jade.goal.NamedSoftgoal

- All Implemented Interfaces:
    MetadataElement, Softgoal, jade.content.Concept, jade.content.ContentElement, jade.content.Term, java.io.Serializable

      public class NamedSoftgoal
      extends MetadataElementImpl
      implements Softgoal, MetadataElement

  This class provides a default implementation for a softgoal, representing it just with a given name. It implements the `MetadataElement` interface, allowing to associate metadata with softgoals.
  Author:
    Ingrid Nunes
  See Also:
    Serialized Form

- - ### Field Summary

    - ### Fields inherited from class bdi4jade.core.MetadataElementImpl

      `metadata`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `NamedSoftgoal()` The default constructor.
    `` | `NamedSoftgoal(java.lang.String name)` Initializes a softgoal with its name.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(java.lang.Object obj)` Returns true of the object is a named softgoal and has the same name of this named softgoal.
    `java.lang.String` | `getName()` Returns the name of this softgoal.
    `int` | `hashCode()` Returns the hash code of this named softgoal.
    `protected void` | `setName(java.lang.String name)` Sets the name of this softgoal.
    `java.lang.String` | `toString()` Returns the string representation of this softgoal, which is its name.

    - ### Methods inherited from class bdi4jade.core.MetadataElementImpl

      `getMetadata, getMetadata, hasMetadata, putMetadata, removeMetadata`

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

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

    - ### Methods inherited from interface bdi4jade.core.MetadataElement

      `getMetadata, getMetadata, hasMetadata, putMetadata, removeMetadata`

- - ### Constructor Detail

    - #### NamedSoftgoal

          protected NamedSoftgoal()

      The default constructor. It should be only used if persistence frameworks are used.

    - #### NamedSoftgoal

          public NamedSoftgoal(java.lang.String name)

      Initializes a softgoal with its name.
      Parameters:
        `name` - the softgoal name.

  - ### Method Detail

    - #### equals

          public final boolean equals(java.lang.Object obj)

      Returns true of the object is a named softgoal and has the same name of this named softgoal.
      Overrides:
        `equals` in class `java.lang.Object`
      Parameters:
        `obj` - to object to be tested if it is equal to this named softgoal.
      See Also:
        `Object.equals(Object)`

    - #### getName

          public java.lang.String getName()

      Returns the name of this softgoal.
      Returns:
        the name.

    - #### hashCode

          public final int hashCode()

      Returns the hash code of this named softgoal.
      Overrides:
        `hashCode` in class `java.lang.Object`
      Returns:
        the hash code of the name of this softgoal.
      See Also:
        `Object.hashCode()`

    - #### setName

          protected void setName(java.lang.String name)

      Sets the name of this softgoal. Ideally, the name should be final and initialized in the constructor. This method should be only used if persistence frameworks are used.
      Parameters:
        `name` - the name to set.

    - #### toString

          public java.lang.String toString()

      Returns the string representation of this softgoal, which is its name.
      Overrides:
        `toString` in class `java.lang.Object`
      See Also:
        `Object.toString()`