# AttrCollection

## Content

# Class: AttrCollection

Represents a collection of [Attr](Attr) objects.

## Extends

- `PdfCollection`&lt;[`Attr`](Attr)&gt;

## Accessors

### count

#### Get Signature

```ts
get count(): number;
```

Gets the number of items in the collection.

##### Returns

`number`

#### Overrides

```ts
PdfCollection.count
```

***

### id

#### Get Signature

```ts
get id(): number;
```

Gets the reference to the object.

##### Returns

`number`

#### Inherited from

```ts
PdfCollection.id
```

***

### last

#### Get Signature

```ts
get last(): TItem;
```

Gets last item in the collection.

##### Returns

`TItem`

#### Inherited from

```ts
PdfCollection.last
```

***

### om

#### Get Signature

```ts
get om(): ObjectManager;
```

Gets the owner [ObjectManager](ObjectManager) instance.

##### Returns

[`ObjectManager`](ObjectManager)

#### Inherited from

```ts
PdfCollection.om
```

## Methods

### add()

```ts
add(item): void;
```

Adds an item to the end of the collection.

#### Parameters

##### item

[`Attr`](Attr)

The item to add.

#### Returns

`void`

#### Inherited from

```ts
PdfCollection.add
```

***

### clear()

```ts
clear(): void;
```

Clears the collection.

#### Returns

`void`

#### Overrides

```ts
PdfCollection.clear
```

***

### contains()

```ts
contains(item): boolean;
```

Determines whether the item is in the collection.

#### Parameters

##### item

[`Attr`](Attr)

#### Returns

`boolean`

true if the item is in the collection, false otherwise.

#### Overrides

```ts
PdfCollection.contains
```

***

### free()

```ts
free(): void;
```

Detaches the object from the [ObjectManager](ObjectManager) and deallocates its memory, if possible.

#### Returns

`void`

#### Inherited from

```ts
PdfCollection.free
```

***

### getAt()

```ts
getAt(index): Attr;
```

Gets the item with the specified index.

#### Parameters

##### index

`number`

The index of the item.

#### Returns

[`Attr`](Attr)

#### Overrides

```ts
PdfCollection.getAt
```

***

### insert()

```ts
insert(index, item): void;
```

Inserts an item at a specific position in the collection.

#### Parameters

##### index

`number`

The position where the item will be inserted.

##### item

[`Attr`](Attr)

The item to insert.

#### Returns

`void`

#### Overrides

```ts
PdfCollection.insert
```

***

### rebind()

```ts
rebind(omTo): void;
```

Rebinds the object from the current [ObjectManager](ObjectManager) to the specified one.

#### Parameters

##### omTo

[`ObjectManager`](ObjectManager)

The new [ObjectManager](ObjectManager) for the object.

#### Returns

`void`

#### Inherited from

```ts
PdfCollection.rebind
```

***

### remove()

```ts
remove(item): boolean;
```

Removes the specified item from the collection.

#### Parameters

##### item

[`Attr`](Attr)

The item to remove.

#### Returns

`boolean`

true if the item was actually removed, false otherwise.

#### Overrides

```ts
PdfCollection.remove
```

***

### removeAt()

```ts
removeAt(index): void;
```

Removes the item at specified index.

#### Parameters

##### index

`number`

The index of the item to remove.

#### Returns

`void`

#### Overrides

```ts
PdfCollection.removeAt
```

***

### setAt()

```ts
setAt(index, item): void;
```

Sets the item at the specified index.

#### Parameters

##### index

`number`

The index of the item, starting from 0.

##### item

[`Attr`](Attr)

The object to set.

#### Returns

`void`

#### Overrides

```ts
PdfCollection.setAt
```
