# Interface: com.pnfsoftware.jeb.core.units.IAddressableUnit

Addressable units allow the retrieval of unit objects via object identifiers and addresses.

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

Description: Retrieve the label at a given address. The default implementation returns null.
parameter: address: mandatory address
return: the label, null if none

## Method: getAddressLabels
- return type: `java.util.Map<java.lang.String,java.lang.String>`

Description: Retrieve all labels. The default implementation returns an empty map.
return: a map of "address: label" value pairs

## Method: getAddressOfItem
- parameter: `id`, type: `long`
- return type: `java.lang.String`

Description: Attempt to determine the best address for a given item. Implementors may return null if a conversion is deemed impossible, inaccurate or irrelevant. 

 Clients use this method to provide navigation capability, for example, jumping from an item to the master \(main\) related item, that would be located at the resulting address. 

 Plugin developers are recommended to implement this method.
parameter: id: the item id
return: an address best representing or matching the provided item, null otherwise

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

Description: Convert the provided address to its canonical form. If the canonical form cannot be determined, the method is allowed to return the provided address.
parameter: address: the address to canonicalize
return: a canonical address, or the provided address if no canonical form is available

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

Description: Attempt to determine the best item for a given address. Implementors may return 0 if a conversion is deemed impossible, inaccurate or irrelevant.
parameter: address: the address
return: an item best representing or matching the provided address, 0 otherwise

## Method: getItemObject
- parameter: `id`, type: `long`
- return type: `java.lang.Object`

Description: Optionally provide an object associated with the given item. This method may return null, an opaque object, or an object defined by the contract of the implementing object or sub\-interface. The SPI of sub\-interfaces should specify the item id formats, if any, as well as types and semantics associated with the objects returned by this method.
parameter: id: the item id
return: an object, whose type is defined by contract, potentially null

## Method: getRelatedItems
- parameter: `id`, type: `long`
- return type: `java.util.List<java.lang.Long>`

Description: Retrieve items related to the provided item id. The definition and context of 'relation' is implementation dependent.
parameter: id: an item id
return: a list of related items \(not containing the provided id\), may be empty \- never null

## Method: getWellKnownAddresses
- parameter: `maxCount`, type: `int`
- parameter: `validator`, type: `java.util.function.Predicate<java.lang.String>`
- return type: `java.util.Collection<java.lang.String>`

Description: Retrieve a collection of valid unit addresses.
parameter: maxCount: optional maximum count of entries to return; use \-1 to remove the cap
parameter: validator: optional validator; only addresses that pass the test will be retrieved
return: a collection of well\-known addresses, possibly empty

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

Description: Determine if the provided address is a valid address for this unit.
parameter: address: the address to validate
return: true if the address is valid

## Method: normalizeAddress
- parameter: `address`, type: `java.lang.String`
- parameter: `form`, type: `com.pnfsoftware.jeb.core.units.AddressForm`
- return type: `java.lang.String`


