Package org.eclipse.mat.parser.internal.snapshot

## Class RetainedSizeCache

- java.lang.Object
- - org.eclipse.mat.parser.internal.snapshot.RetainedSizeCache

All Implemented Interfaces:
  `IIndexReader`

    public class RetainedSizeCache
    extends java.lang.Object
    implements IIndexReader

### Nested Class Summary

### Nested classes/interfaces inherited from interface org.eclipse.mat.parser.index.IIndexReader

`IIndexReader.IOne2LongIndex, IIndexReader.IOne2ManyIndex, IIndexReader.IOne2ManyObjectsIndex, IIndexReader.IOne2OneIndex, IIndexReader.IOne2SizeIndex`

### Constructor Summary

Constructors
`RetainedSizeCache​(java.io.File f)` File is expected to exist, and is read in the new format.
`RetainedSizeCache​(XSnapshotInfo snapshotInfo)` Reads file i2sv2.index in new format, or file i2s.index in the old format, or creates an empty map.

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `close()` Close the backing file.
`void` `delete()` Delete the backing file.
`long` `get​(int key)`
`void` `put​(int key, long value)`
`int` `size()` Size of the index
`void` `unload()` Clear the caches.

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

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

### Constructor Detail

#### RetainedSizeCache

    public RetainedSizeCache​(java.io.File f)

File is expected to exist, and is read in the new format.

Parameters:
  `f` -

#### RetainedSizeCache

    public RetainedSizeCache​(XSnapshotInfo snapshotInfo)

Reads file i2sv2.index in new format, or file i2s.index in the old format, or creates an empty map.

Parameters:
  `snapshotInfo` -

### Method Detail

#### get

    public long get​(int key)

#### put

    public void put​(int key,
                    long value)

#### close

    public void close()

Description copied from interface: `IIndexReader`
Close the backing file.

Specified by:
  `close` in interface `IIndexReader`

#### size

    public int size()

Description copied from interface: `IIndexReader`
Size of the index

Specified by:
  `size` in interface `IIndexReader`
Returns:
  number of entries

#### unload

    public void unload()
                throws java.io.IOException

Description copied from interface: `IIndexReader`
Clear the caches. Used when the indexes are not current in use and the memory needs to be reclaimed such as when building the dominator tree.

Specified by:
  `unload` in interface `IIndexReader`
Throws:
  `java.io.IOException`

#### delete

    public void delete()

Description copied from interface: `IIndexReader`
Delete the backing file.

Specified by:
  `delete` in interface `IIndexReader`