# Class MemoryBasedReadEndsForMarkDuplicatesMap

java.lang.Object
picard.sam.markduplicates.util.MemoryBasedReadEndsForMarkDuplicatesMap

All Implemented Interfaces:
  `ReadEndsForMarkDuplicatesMap`

public class MemoryBasedReadEndsForMarkDuplicatesMap extends Object implements ReadEndsForMarkDuplicatesMap
Map from String to ReadEnds object. Memory-based implementation. Used for MarkDuplicates.

## Constructor Summary

Constructors
Constructor
Description
`MemoryBasedReadEndsForMarkDuplicatesMap()`

## Method Summary

Modifier and Type
Method
Description
`void`
`put(int mateSequenceIndex, String key, ReadEndsForMarkDuplicates readEnds)`
Store the element in the map with the given key.
`ReadEndsForMarkDuplicates`
`remove(int mateSequenceIndex, String key)`
Remove element with given key from the map.
`int`
`size()`
`int`
`sizeInRam()`

### Methods inherited from class Object

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

## Constructor Details

### MemoryBasedReadEndsForMarkDuplicatesMap

public MemoryBasedReadEndsForMarkDuplicatesMap()

## Method Details

### remove

public ReadEndsForMarkDuplicates remove(int mateSequenceIndex, String key)
Description copied from interface: `ReadEndsForMarkDuplicatesMap`
Remove element with given key from the map. Because an implementation may be disk-based, the object returned may not be the same object that was put into the map

Specified by:
  `remove` in interface `ReadEndsForMarkDuplicatesMap`
Parameters:
  `mateSequenceIndex` - must agree with the value used when the object was put into the map
  `key` - typically, concatenation of read group ID and read name
Returns:
  null if the key is not found, otherwise the object removed.

### put

public void put(int mateSequenceIndex, String key, ReadEndsForMarkDuplicates readEnds)
Description copied from interface: `ReadEndsForMarkDuplicatesMap`
Store the element in the map with the given key. It is assumed that the element is not already present in the map.

Specified by:
  `put` in interface `ReadEndsForMarkDuplicatesMap`
Parameters:
  `mateSequenceIndex` - use to optimize storage invalid input: '&' retrieval. The same value must be used when trying to remove this element. It is not valid to store the same key with two different mateSequenceIndexes.
  `key` - typically, concatenation of read group ID and read name
  `readEnds` - the object to be stored

### size

public int size()

Specified by:
  `size` in interface `ReadEndsForMarkDuplicatesMap`
Returns:
  number of elements stored in map

### sizeInRam

public int sizeInRam()

Specified by:
  `sizeInRam` in interface `ReadEndsForMarkDuplicatesMap`
Returns:
  number of elements stored in RAM. Always invalid input: '<'= size()