[]
        
(Showing Draft Content)

ClassMap

Class: ClassMap

Represents the value of the ClassMap entry of the structure tree: a dictionary that maps name objects designating attribute classes to the corresponding collections of attribute objects (AttrCollection). See the PDF specification for details.

Keys are PDF names (plain JS strings); values are AttrCollection objects.

Obtain it from StructTreeRoot#classMap.

Extends

Accessors

count

Get Signature

get count(): number;

Gets the number of entries in the map.

Returns

number


id

Get Signature

get id(): number;

Gets the reference to the object.

Returns

number

Inherited from

ObjectBase.id


om

Get Signature

get om(): ObjectManager;

Gets the owner ObjectManager instance.

Returns

ObjectManager

Inherited from

ObjectBase.om

Methods

clear()

clear(): void;

Removes all entries from the map.

Returns

void


contains()

contains(key): boolean;

Determines whether the map contains the specified key.

Parameters

key

string

The attribute class name to check.

Returns

boolean

true if the key is present, false otherwise.


entries()

entries(): [string, AttrCollection][];

Gets the array of key/value pairs in the map.

Returns

[string, AttrCollection][]


free()

free(): void;

Detaches the object from the ObjectManager and deallocates its memory, if possible.

Returns

void

Inherited from

ObjectBase.free


get()

get(key): AttrCollection;

Gets the collection of attribute objects mapped to the specified key.

Parameters

key

string

The attribute class name.

Returns

AttrCollection

The mapped AttrCollection, or undefined if the key is not present.


getOrCreate()

getOrCreate(key): AttrCollection;

Gets the collection of attribute objects mapped to the specified key, creating and storing an empty AttrCollection if the key is not yet present.

Parameters

key

string

The attribute class name.

Returns

AttrCollection

The AttrCollection mapped to the key.


keys()

keys(): string[];

Gets the array of keys (the attribute class names).

Returns

string[]


rebind()

rebind(omTo): void;

Rebinds the object from the current ObjectManager to the specified one.

Parameters

omTo

ObjectManager

The new ObjectManager for the object.

Returns

void

Inherited from

ObjectBase.rebind


remove()

remove(key): boolean;

Removes the entry with the specified key.

Parameters

key

string

The attribute class name to remove.

Returns

boolean

true if the entry was actually removed, false otherwise.


set()

set(key, value): void;

Maps the specified attribute class name to a collection of attribute objects.

Parameters

key

string

The attribute class name.

value

AttrCollection

The AttrCollection to map to the key.

Returns

void