bdi4jade.core

## Class MetadataElementImpl

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

- All Implemented Interfaces:
    MetadataElement
  Direct Known Subclasses:
    AbstractBelief, AbstractPlan, NamedSoftgoal

      public abstract class MetadataElementImpl
      extends java.lang.Object
      implements MetadataElement

  This class provides an implementation to the `MetadataElement`. It is able to store metadata.
  Author:
    Ingrid Nunes

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected java.util.Map<java.lang.Object,java.lang.Object>` | `metadata`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `MetadataElementImpl()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.util.Map<?,?>` | `getMetadata()`
    `java.lang.Object` | `getMetadata(java.lang.Object name)` Gets a value of a metadata.
    `boolean` | `hasMetadata(java.lang.Object name)` Verifies if a metadata is associated with this element.
    `void` | `putMetadata(java.lang.Object name, java.lang.Object value)` Put a metadata in this element.
    `java.lang.Object` | `removeMetadata(java.lang.Object name)` Removes a metadata of this element.

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

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

- - ### Field Detail

    - #### metadata

          protected java.util.Map<java.lang.Object,java.lang.Object> metadata

  - ### Constructor Detail

    - #### MetadataElementImpl

          public MetadataElementImpl()

  - ### Method Detail

    - #### getMetadata

          public java.util.Map<?,?> getMetadata()

      Specified by:
        `getMetadata` in interface `MetadataElement`
      Returns:
        the metadata
      See Also:
        `MetadataElement.getMetadata()`

    - #### getMetadata

          public java.lang.Object getMetadata(java.lang.Object name)

      Description copied from interface: `MetadataElement`
      Gets a value of a metadata.
      Specified by:
        `getMetadata` in interface `MetadataElement`
      Parameters:
        `name` - the name of the metadata.
      Returns:
        the existing value of this metadata.
      See Also:
        `MetadataElement.getMetadata(Object)`

    - #### hasMetadata

          public boolean hasMetadata(java.lang.Object name)

      Description copied from interface: `MetadataElement`
      Verifies if a metadata is associated with this element.
      Specified by:
        `hasMetadata` in interface `MetadataElement`
      Parameters:
        `name` - the name of the metadata.
      Returns:
        true if the element has this metadata.
      See Also:
        `MetadataElement.hasMetadata(Object)`

    - #### putMetadata

          public void putMetadata(java.lang.Object name,
                                  java.lang.Object value)

      Description copied from interface: `MetadataElement`
      Put a metadata in this element. If it does not exists, it is added, and it is update otherwise.
      Specified by:
        `putMetadata` in interface `MetadataElement`
      Parameters:
        `name` - the name of the metadata.
        `value` - the value associated with this metadata.
      See Also:
        `MetadataElement.putMetadata(Object, Object)`

    - #### removeMetadata

          public java.lang.Object removeMetadata(java.lang.Object name)

      Description copied from interface: `MetadataElement`
      Removes a metadata of this element.
      Specified by:
        `removeMetadata` in interface `MetadataElement`
      Parameters:
        `name` - the name of the metadata.
      Returns:
        the existing value of this metadata.
      See Also:
        `MetadataElement.removeMetadata(Object)`