com.h3c.util

## Class SharedMemory<D>

- java.lang.Object
- - com.h3c.util.SharedMemory<D>

- Type Parameters:
    `D` - type of the data

      public class SharedMemory<D>
      extends Object

  Shared memory. This class makes sure all threads access the same data and not a local copy.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `SharedMemory()` Creates a shared memory
    `SharedMemory(D data)` Creates a shared memory

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `D` | `read()` Read the memory
    `void` | `write(D data)` Writes data to the memory

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

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

- - ### Constructor Detail

    - #### SharedMemory

          public SharedMemory()

      Creates a shared memory

    - #### SharedMemory

          public SharedMemory(D data)

      Creates a shared memory
      Parameters:
        `data` - data

  - ### Method Detail

    - #### read

          public D read()

      Read the memory
      Returns:
        data

    - #### write

          public void write(D data)

      Writes data to the memory
      Parameters:
        `data` - data to write

Copyright © 2014. All Rights Reserved.