Attributes (Apache OpenNLP Tools 1.9.5 API)
Date: 2026-06-18

opennlp.tools.dictionary.serializer

## Class Attributes

- java.lang.Object
- - opennlp.tools.dictionary.serializer.Attributes

-     public class Attributes
      extends Object

  The `Attributes` class stores name value pairs. Problem: The HashMap for storing the name value pairs has a very high memory footprint, replace it.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Attributes()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `getValue(String key)` Retrieves the value for the given key or null if attribute it not set.
    `Iterator<String>` | `iterator()` Iterates over the keys.
    `void` | `setValue(String key, String value)` Sets a key/value pair.

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

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

- - ### Constructor Detail

    - #### Attributes

          public Attributes()

  - ### Method Detail

    - #### getValue

          public String getValue(String key)

      Retrieves the value for the given key or null if attribute it not set.
      Parameters:
        `key` -
      Returns:
        the value

    - #### setValue

          public void setValue(String key,
                               String value)

      Sets a key/value pair.
      Parameters:
        `key` -
        `value` -

    - #### iterator

          public Iterator<String> iterator()

      Iterates over the keys.
      Returns:
        key-`Iterator`

Copyright © 2026 The Apache Software Foundation. All rights reserved.