# Class: com.pnfsoftware.jeb.core.units.impl.AbstractCommentManager

A comment manager to be used by [IInteractiveUnit](IInteractiveUnit). It supports dual\-addressing: regular string address \(per the interactive unit specifications\), and custom address \(methods for custom addressing are suffixed by `2`\). The conversion methods are to be provided by the subclass. 

 Specialized subclasses exist.

## Protected Constructor: AbstractCommentManager
- parameter: `unit`, type: `U`

Description: Create a comment manager.
parameter: unit: managed unit

## Static Field: COMMENT_FLAG_FAVORITE
Type: `int`

Constant value: `4096`
Description: Flag indicating that a comment should be treated as a favorite marker.

## Static Field: INLINE
Type: `int`

Constant value: `0`
Description: Constant used to identify an item's primary comment inlined with the item \(for rendering purposes\).

## Static Field: PRE
Type: `int`

Constant value: `-1`
Description: Constant used to identify an item's primary comment located above/before the item \(for rendering purposes\).

## Method: addMetaComment
- parameter: `address`, type: `java.lang.String`
- parameter: `str`, type: `java.lang.String`
- parameter: `notify`, type: `boolean`
- return type: `boolean`

Description: Add a meta\-comment at the provided address.
parameter: address: address
parameter: str: comment text
parameter: notify: true to notify listeners
return: success indicator

## Method: addMetaComment
- parameter: `address`, type: `java.lang.String`
- parameter: `c`, type: `com.pnfsoftware.jeb.core.units.impl.MetaComment`
- parameter: `notify`, type: `boolean`
- return type: `boolean`

Description: Add a meta\-comment at the provided address.
parameter: address: address
parameter: c: meta\-comment
parameter: notify: true to notify listeners
return: success indicator

## Method: addMetaComment2
- parameter: `coord`, type: `C`
- parameter: `str`, type: `java.lang.String`
- parameter: `notify`, type: `boolean`
- return type: `boolean`

Description: Add a meta\-comment at the provided coordinate.
parameter: coord: coordinate
parameter: str: comment text
parameter: notify: true to notify listeners
return: success indicator

## Method: addMetaComment2
- parameter: `coord`, type: `C`
- parameter: `c`, type: `com.pnfsoftware.jeb.core.units.impl.MetaComment`
- parameter: `notify`, type: `boolean`
- return type: `boolean`

Description: Add a meta\-comment at the provided coordinate.
parameter: coord: coordinate
parameter: c: meta\-comment
parameter: notify: true to notify listeners
return: success indicator

## Method: addressToCoord
- parameter: `address`, type: `java.lang.String`
- return type: `C`

Description: Convert a string address to a custom coordinate.
parameter: address: address
return: coordinate, or null if the address cannot be converted

## Method: coordToAddress
- parameter: `coord`, type: `C`
- return type: `java.lang.String`

Description: Convert a custom coordinate to a string address.
parameter: coord: coordinate
return: address, or null if the coordinate cannot be converted

## Method: formatComments
- parameter: `address`, type: `java.lang.String`
- parameter: `includePre`, type: `boolean`
- parameter: `flagsMustHave`, type: `int`
- parameter: `flagsCantHave`, type: `int`
- return type: `java.lang.String`

Description: Format comments at the provided address.
parameter: address: address
parameter: includePre: true to include the pre\-comment
parameter: flagsMustHave: mask of meta\-comment flags that must be present
parameter: flagsCantHave: mask of meta\-comment flags that must be absent
return: formatted comments, or an empty string if none

## Method: formatComments2
- parameter: `coord`, type: `C`
- parameter: `includePre`, type: `boolean`
- parameter: `flagsMustHave`, type: `int`
- parameter: `flagsCantHave`, type: `int`
- return type: `java.lang.String`

Description: Format comments at the provided coordinate.
parameter: coord: coordinate
parameter: includePre: true to include the pre\-comment
parameter: flagsMustHave: mask of meta\-comment flags that must be present
parameter: flagsCantHave: mask of meta\-comment flags that must be absent
return: formatted comments, or an empty string if none

## Method: formatMetaComment
- parameter: `c`, type: `com.pnfsoftware.jeb.core.units.impl.MetaComment`
- return type: `java.lang.String`

Description: Format a meta\-comment for display.
parameter: c: meta\-comment
return: formatted meta\-comment

## Method: formatMetaFlags
- parameter: `flags`, type: `int`
- return type: `java.lang.String`

Description: Format meta\-comment flags for display.
parameter: flags: flags
return: formatted flags

## Method: getComment
- parameter: `address`, type: `java.lang.String`
- return type: `com.pnfsoftware.jeb.core.units.impl.Comment`

Description: Retrieve the comment at the provided address.
parameter: address: address
return: the comment, or null if none

## Method: getComment2
- parameter: `coord`, type: `C`
- return type: `com.pnfsoftware.jeb.core.units.impl.Comment`

Description: Retrieve the comment at the provided coordinate.
parameter: coord: coordinate
return: the comment, or null if none

## Method: getComments
- return type: `java.util.Map<java.lang.String,com.pnfsoftware.jeb.core.units.impl.Comment>`

Description: Retrieve comments keyed by string address.
return: a map of addresses to comments

## Method: getComments2
- return type: `java.util.Map<C,com.pnfsoftware.jeb.core.units.impl.Comment>`

Description: Retrieve comments keyed by custom coordinate.
return: a map of coordinates to comments

## Method: getInlineComment
- parameter: `address`, type: `java.lang.String`
- return type: `java.lang.String`

Description: Retrieve the inline comment at the provided address.
parameter: address: address
return: the inline comment, or null if none

## Method: getInlineComment2
- parameter: `coord`, type: `C`
- return type: `java.lang.String`

Description: Retrieve the inline comment at the provided coordinate.
parameter: coord: coordinate
return: the inline comment, or null if none

## Method: getMetaCommentObjects
- parameter: `address`, type: `java.lang.String`
- parameter: `flagsMustHave`, type: `int`
- parameter: `flagsCantHave`, type: `int`
- return type: `java.util.Collection<java.lang.String>`

Description: Retrieve meta\-comment text values at the provided address filtered by flags.
parameter: address: address
parameter: flagsMustHave: mask of flags that must be present
parameter: flagsCantHave: mask of flags that must be absent
return: filtered meta\-comment text values

## Method: getMetaCommentObjects2
- parameter: `coord`, type: `C`
- parameter: `flagsMustHave`, type: `int`
- parameter: `flagsCantHave`, type: `int`
- return type: `java.util.Collection<java.lang.String>`

Description: Retrieve meta\-comment text values at the provided coordinate filtered by flags.
parameter: coord: coordinate
parameter: flagsMustHave: mask of flags that must be present
parameter: flagsCantHave: mask of flags that must be absent
return: filtered meta\-comment text values

## Method: getMetaComments
- parameter: `address`, type: `java.lang.String`
- return type: `java.util.Collection<com.pnfsoftware.jeb.core.units.impl.MetaComment>`

Description: Retrieve meta\-comments at the provided address.
parameter: address: address
return: meta\-comments, possibly empty

## Method: getMetaComments
- parameter: `address`, type: `java.lang.String`
- parameter: `flagsMustHave`, type: `int`
- parameter: `flagsCantHave`, type: `int`
- return type: `java.util.Collection<com.pnfsoftware.jeb.core.units.impl.MetaComment>`

Description: Retrieve meta\-comments at the provided address filtered by flags.
parameter: address: address
parameter: flagsMustHave: mask of flags that must be present
parameter: flagsCantHave: mask of flags that must be absent
return: filtered meta\-comments, possibly empty

## Method: getMetaComments2
- parameter: `coord`, type: `C`
- return type: `java.util.Collection<com.pnfsoftware.jeb.core.units.impl.MetaComment>`

Description: Retrieve meta\-comments at the provided coordinate.
parameter: coord: coordinate
return: meta\-comments, possibly empty

## Method: getMetaComments2
- parameter: `coord`, type: `C`
- parameter: `flagsMustHave`, type: `int`
- parameter: `flagsCantHave`, type: `int`
- return type: `java.util.Collection<com.pnfsoftware.jeb.core.units.impl.MetaComment>`

Description: Retrieve meta\-comments at the provided coordinate filtered by flags.
parameter: coord: coordinate
parameter: flagsMustHave: mask of flags that must be present
parameter: flagsCantHave: mask of flags that must be absent
return: filtered meta\-comments, possibly empty

## Method: getPreComment
- parameter: `address`, type: `java.lang.String`
- return type: `java.lang.String`

Description: Retrieve the pre\-comment at the provided address.
parameter: address: address
return: the pre\-comment, or null if none

## Method: getPreComment2
- parameter: `coord`, type: `C`
- return type: `java.lang.String`

Description: Retrieve the pre\-comment at the provided coordinate.
parameter: coord: coordinate
return: the pre\-comment, or null if none

## Method: getPrimary
- parameter: `address`, type: `java.lang.String`
- parameter: `position`, type: `int`
- return type: `java.lang.String`

Description: Retrieve a primary comment at the provided address.
parameter: address: address
parameter: position: one of [#INLINE](#INLINE) or [#PRE](#PRE)
return: the primary comment, or null if none

## Method: getPrimary2
- parameter: `coord`, type: `C`
- parameter: `position`, type: `int`
- return type: `java.lang.String`

Description: Retrieve a primary comment at the provided coordinate.
parameter: coord: coordinate
parameter: position: one of [#INLINE](#INLINE) or [#PRE](#PRE)
return: the primary comment, or null if none

## Method: getPrimaryMap
- parameter: `position`, type: `int`
- return type: `java.util.Map<java.lang.String,java.lang.String>`

Description: Retrieve primary comments keyed by string address.
parameter: position: one of [#INLINE](#INLINE) or [#PRE](#PRE)
return: a map of addresses to primary comments

## Method: getPrimaryMap2
- parameter: `position`, type: `int`
- return type: `java.util.Map<C,java.lang.String>`

Description: Retrieve primary comments keyed by custom coordinate.
parameter: position: one of [#INLINE](#INLINE) or [#PRE](#PRE)
return: a map of coordinates to primary comments

## Method: getUnit
- return type: `U`

Description: Retrieve the managed unit.
return: the managed unit

## Method: putAll
- parameter: `map`, type: `java.util.Map<C,com.pnfsoftware.jeb.core.units.impl.Comment>`

Description: Add all provided comments to this manager.
parameter: map: comments keyed by coordinate

## Method: removeMetaComment
- parameter: `address`, type: `java.lang.String`
- parameter: `c`, type: `com.pnfsoftware.jeb.core.units.impl.MetaComment`
- parameter: `notify`, type: `boolean`
- return type: `boolean`

Description: Remove a meta\-comment at the provided address.
parameter: address: address
parameter: c: meta\-comment to remove
parameter: notify: true to notify listeners
return: success indicator

## Method: removeMetaComment2
- parameter: `coord`, type: `C`
- parameter: `c`, type: `com.pnfsoftware.jeb.core.units.impl.MetaComment`
- parameter: `notify`, type: `boolean`
- return type: `boolean`

Description: Remove a meta\-comment at the provided coordinate.
parameter: coord: coordinate
parameter: c: meta\-comment to remove
parameter: notify: true to notify listeners
return: success indicator

## Method: setComment
- parameter: `address`, type: `java.lang.String`
- parameter: `comment`, type: `com.pnfsoftware.jeb.core.units.impl.Comment`
- parameter: `notify`, type: `boolean`
- return type: `boolean`

Description: Set or delete the comment at the provided address.
parameter: address: address
parameter: comment: new comment; null to delete
parameter: notify: true to notify listeners
return: success indicator

## Method: setComment2
- parameter: `coord`, type: `C`
- parameter: `comment`, type: `com.pnfsoftware.jeb.core.units.impl.Comment`
- parameter: `notify`, type: `boolean`
- return type: `boolean`

Description: Set or delete the comment at the provided coordinate.
parameter: coord: coordinate
parameter: comment: new comment; null to delete
parameter: notify: true to notify listeners
return: success indicator

## Method: setInlineComment
- parameter: `address`, type: `java.lang.String`
- parameter: `value`, type: `java.lang.String`
- return type: `boolean`

Description: Set or delete the inline comment at the provided address and notify listeners.
parameter: address: address
parameter: value: new comment; null or empty to delete
return: success indicator

## Method: setInlineComment
- parameter: `address`, type: `java.lang.String`
- parameter: `value`, type: `java.lang.String`
- parameter: `notify`, type: `boolean`
- return type: `boolean`

Description: Set or delete the inline comment at the provided address.
parameter: address: address
parameter: value: new comment; null or empty to delete
parameter: notify: true to notify listeners
return: success indicator

## Method: setInlineComment2
- parameter: `coord`, type: `C`
- parameter: `value`, type: `java.lang.String`
- return type: `boolean`

Description: Set or delete the inline comment at the provided coordinate and notify listeners.
parameter: coord: coordinate
parameter: value: new comment; null or empty to delete
return: success indicator

## Method: setInlineComment2
- parameter: `coord`, type: `C`
- parameter: `value`, type: `java.lang.String`
- parameter: `notify`, type: `boolean`
- return type: `boolean`

Description: Set or delete the inline comment at the provided coordinate.
parameter: coord: coordinate
parameter: value: new comment; null or empty to delete
parameter: notify: true to notify listeners
return: success indicator

## Method: setPreComment
- parameter: `address`, type: `java.lang.String`
- parameter: `value`, type: `java.lang.String`
- return type: `boolean`

Description: Set or delete the pre\-comment at the provided address and notify listeners.
parameter: address: address
parameter: value: new comment; null or empty to delete
return: success indicator

## Method: setPreComment
- parameter: `address`, type: `java.lang.String`
- parameter: `value`, type: `java.lang.String`
- parameter: `notify`, type: `boolean`
- return type: `boolean`

Description: Set or delete the pre\-comment at the provided address.
parameter: address: address
parameter: value: new comment; null or empty to delete
parameter: notify: true to notify listeners
return: success indicator

## Method: setPreComment2
- parameter: `coord`, type: `C`
- parameter: `value`, type: `java.lang.String`
- return type: `boolean`

Description: Set or delete the pre\-comment at the provided coordinate and notify listeners.
parameter: coord: coordinate
parameter: value: new comment; null or empty to delete
return: success indicator

## Method: setPreComment2
- parameter: `coord`, type: `C`
- parameter: `value`, type: `java.lang.String`
- parameter: `notify`, type: `boolean`
- return type: `boolean`

Description: Set or delete the pre\-comment at the provided coordinate.
parameter: coord: coordinate
parameter: value: new comment; null or empty to delete
parameter: notify: true to notify listeners
return: success indicator

## Method: setPrimary
- parameter: `address`, type: `java.lang.String`
- parameter: `value`, type: `java.lang.String`
- parameter: `position`, type: `int`
- parameter: `notify`, type: `boolean`
- return type: `boolean`

Description: Set or delete a primary comment at the provided address.
parameter: address: address
parameter: value: new comment; null or empty to delete
parameter: position: one of [#INLINE](#INLINE) or [#PRE](#PRE)
parameter: notify: true to notify listeners
return: success indicator

## Method: setPrimary2
- parameter: `coord`, type: `C`
- parameter: `value`, type: `java.lang.String`
- parameter: `position`, type: `int`
- parameter: `notify`, type: `boolean`
- return type: `boolean`

Description: Set or delete a primary comment at the provided coordinate.
parameter: coord: coordinate
parameter: value: new comment; null or empty to delete
parameter: position: one of [#INLINE](#INLINE) or [#PRE](#PRE)
parameter: notify: true to notify listeners
return: success indicator

