# Interface IAnnotationMap

All Superinterfaces:
  `ISynchronizable, Map<Annotation, Position>`

public interface IAnnotationMap extends Map<Annotation, Position>, ISynchronizable
An annotation map is a map specialized for the requirements of an annotation model. The annotation map supports a customizable lock object which is used to synchronize concurrent operations on the map (see `ISynchronizable`. The map supports two iterator methods, one for the values and one for the keys of the map. The returned iterators are robust, i.e. they work on a copy of the values and keys set that is made at the point in time the iterator methods are called.

The returned collections of the methods `values`, `entrySet`, and `keySet` are not synchronized on the annotation map's lock object.

Since:
  3.0
See Also:
  - `IAnnotationModel`

## Nested Class Summary

### Nested classes/interfaces inherited from interface Map

`Map.Entry<K,V>`

## Method Summary

Modifier and Type
Method
Description
`Set<Map.Entry<Annotation, Position>>`
`entrySet()`
The returned set is not synchronized on this annotation map's lock object.
`Object`
`getLockObject()`
Implementers of this interface should never return null.
`Set<Annotation>`
`keySet()`
The returned set is not synchronized on this annotation map's lock object.
`Iterator<Annotation>`
`keySetIterator()`
Returns an iterator for a copy of this map's key set.
`void`
`setLockObject(Object lockObject)`
Sets the lock object for this object.
`Collection<Position>`
`values()`
The returned collection is not synchronized on this annotation map's lock object.
`Iterator<Position>`
`valuesIterator()`
Returns an iterator for a copy of this annotation map's values.

### Methods inherited from interface Map

`clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, equals, forEach, get, getOrDefault, hashCode, isEmpty, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size`

## Method Details

### valuesIterator

Iterator<Position> valuesIterator()
Returns an iterator for a copy of this annotation map's values.

Returns:
  an iterator for a copy of this map's values

### keySetIterator

Iterator<Annotation> keySetIterator()
Returns an iterator for a copy of this map's key set.

Returns:
  an iterator for a copy of this map's key set

### entrySet

Set<Map.Entry<Annotation, Position>> entrySet()
The returned set is not synchronized on this annotation map's lock object.

Specified by:
  `entrySet` in interface `Map<Annotation, Position>`

### keySet

Set<Annotation> keySet()
The returned set is not synchronized on this annotation map's lock object.

Specified by:
  `keySet` in interface `Map<Annotation, Position>`

### values

Collection<Position> values()
The returned collection is not synchronized on this annotation map's lock object.

Specified by:
  `values` in interface `Map<Annotation, Position>`

### getLockObject

Object getLockObject()
Implementers of this interface should never return null. Clients should use the lock object in order to synchronize concurrent access to the implementer.

Specified by:
  `getLockObject` in interface `ISynchronizable`
Returns:
  the lock object to be used, if no explicit lock object is set, internal one should be used, therefore never `null`

### setLockObject

void setLockObject(Object lockObject)
Sets the lock object for this object. Subsequent calls to specified methods of this object are synchronized on this lock object. Which methods are synchronized is specified by the implementer.

You should not override an existing lock object unless you own that lock object yourself. Use the existing lock object instead.

Specified by:
  `setLockObject` in interface `ISynchronizable`
Parameters:
  `lockObject` - the lock object. Never `null`.