org.eclipse.handly.model.impl.support

## Interface IBodyCache

-     public interface IBodyCache

  Represents a cache of element handle/body relationships.
  See Also:
    `IElement`, `Body`, `ElementManager`, `ElementCache`

- - ### Method Summary

    All Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.Object` | `get(IElement element)` Returns the corresponding body for the given element, or `null` if this cache contains no body for the element.
    `java.lang.Object` | `peek(IElement element)` Returns the corresponding body for the given element without disturbing cache ordering, or `null` if this cache contains no body for the element.
    `void` | `put(IElement element, java.lang.Object body)` Remembers the given body for the given element in this cache.
    `default void` | `putAll(java.util.Map<? extends IElement,java.lang.Object> elementBodies)` Remembers the given element handle/body relationships in this cache.
    `void` | `remove(IElement element)` Removes the corresponding body for the given element from this cache.

- - ### Method Detail

    - #### get

          java.lang.Object get(IElement element)

      Returns the corresponding body for the given element, or `null` if this cache contains no body for the element.
      Parameters:
        `element` - the element whose body is to be returned
      Returns:
        the corresponding body for the given element, or `null` if the cache contains no body for the element

    - #### peek

          java.lang.Object peek(IElement element)

      Returns the corresponding body for the given element without disturbing cache ordering, or `null` if this cache contains no body for the element.
      Parameters:
        `element` - the element whose body is to be returned
      Returns:
        the corresponding body for the given element, or `null` if the cache contains no body for the element

    - #### put

          void put(IElement element,
                   java.lang.Object body)

      Remembers the given body for the given element in this cache. If the cache previously contained a body for the element, the old body is replaced with the given body.
      Parameters:
        `element` - the element with which the given body is to be associated (not `null`)
        `body` - the body to be associated with the given element (not `null`)

    - #### putAll

          default void putAll(java.util.Map<? extends IElement,java.lang.Object> elementBodies)

      Remembers the given element handle/body relationships in this cache.
      Parameters:
        `elementBodies` - element handle/body relationships to be stored in the cache (not `null`)

    - #### remove

          void remove(IElement element)

      Removes the corresponding body for the given element from this cache. Does nothing if the cache contains no body for the element.
      Parameters:
        `element` - the element whose body is to be removed from the cache

Copyright (c) 2014, 2020 1C-Soft LLC and others. Made available under the Eclipse Public License 2.0