# Class ObjectDeque<E>

#### Type Parameters

- #### E = number

#### Hierarchy

- ObjectDeque

- Defined in src/data-structures/queue/deque.ts:17

#####
Index

### Constructors

constructor

### Properties

_capacity
_first
_last
_nodes
_size

### Accessors

capacity
first
last
nodes
size

### Methods

_seNodes
_setSize
addFirst
addLast
get
isEmpty
peekFirst
peekLast
pollFirst
pollLast

## Constructors

### constructor

- new ObjectDeque<E>(capacity?): ObjectDeque<E>

- #### Type Parameters

  - #### E = number

  #### Parameters

  - ##### `Optional` capacity: number

  #### Returns ObjectDeque<E>

  - Defined in src/data-structures/queue/deque.ts:18

## Properties

### `Private` _capacity

_capacity: number = Number.MAX_SAFE_INTEGER

- Defined in src/data-structures/queue/deque.ts:28

### `Private` _first

_first: number = -1

- Defined in src/data-structures/queue/deque.ts:38

### `Private` _last

_last: number = -1

- Defined in src/data-structures/queue/deque.ts:48

### `Private` _nodes

_nodes: {
[key: number]: E;
} = {}

#### Type declaration

- ##### [key: number]: E

- Defined in src/data-structures/queue/deque.ts:22

### `Private` _size

_size: number = 0

- Defined in src/data-structures/queue/deque.ts:58

## Accessors

### capacity

- get capacity(): number

- #### Returns number

  - Defined in src/data-structures/queue/deque.ts:30
- set capacity(value): void

- #### Parameters

  - ##### value: number

  #### Returns void

  - Defined in src/data-structures/queue/deque.ts:34

### first

- get first(): number

- #### Returns number

  - Defined in src/data-structures/queue/deque.ts:40
- set first(value): void

- #### Parameters

  - ##### value: number

  #### Returns void

  - Defined in src/data-structures/queue/deque.ts:44

### last

- get last(): number

- #### Returns number

  - Defined in src/data-structures/queue/deque.ts:50
- set last(value): void

- #### Parameters

  - ##### value: number

  #### Returns void

  - Defined in src/data-structures/queue/deque.ts:54

### nodes

- get nodes(): {
  [p: number]: E;
  }

- #### Returns {
  [p: number]: E;
  }

  - ##### [p: number]: E

  - Defined in src/data-structures/queue/deque.ts:24

### size

- get size(): number

- #### Returns number

  - Defined in src/data-structures/queue/deque.ts:60

## Methods

### `Protected` _seNodes

- _seNodes(value): void

- #### Parameters

  - ##### value: {
    [p: number]: E;
    }

    - ##### [p: number]: E

  #### Returns void

  - Defined in src/data-structures/queue/deque.ts:159

### `Protected` _setSize

- _setSize(value): void

- #### Parameters

  - ##### value: number

  #### Returns void

  - Defined in src/data-structures/queue/deque.ts:163

### addFirst

- addFirst(value): void

- The "addFirst" function adds a value to the beginning of an array-like data structure.

  #### Parameters

  - ##### value: E

    The `value` parameter represents the value that you want to add to the beginning of the data structure.

  #### Returns void

  - Defined in src/data-structures/queue/deque.ts:69

### addLast

- addLast(value): void

- The addLast function adds a value to the end of an array-like data structure.

  #### Parameters

  - ##### value: E

    The `value` parameter represents the value that you want to add to the end of the data structure.

  #### Returns void

  - Defined in src/data-structures/queue/deque.ts:85

### get

- get(index): null | NonNullable<E>

- The get function returns the element at the specified index in an array-like data structure.

  #### Parameters

  - ##### index: number

    The index parameter is a number that represents the position of the element you want to retrieve from the array.

  #### Returns null | NonNullable<E>

  The element at the specified index in the `_nodes` array is being returned. If there is no element at that index, `null` is returned.

  - Defined in src/data-structures/queue/deque.ts:147

### isEmpty

- isEmpty(): boolean

- The function checks if the size of a data structure is less than or equal to zero.

  #### Returns boolean

  The method is returning a boolean value indicating whether the size of the object is less than or equal to 0.

  - Defined in src/data-structures/queue/deque.ts:155

### peekFirst

- peekFirst(): undefined | E

- The `peekFirst` function returns the first element in an array-like data structure if it exists.

  #### Returns undefined | E

  The element at the first position of the `_nodes` array.

  - Defined in src/data-structures/queue/deque.ts:114

### peekLast

- peekLast(): undefined | E

- The `peekLast()` function returns the last element in an array-like data structure.

  #### Returns undefined | E

  The last element in the array "_nodes" is being returned.

  - Defined in src/data-structures/queue/deque.ts:136

### pollFirst

- pollFirst(): undefined | E

- The function `pollFirst()` removes and returns the first element in a data structure.

  #### Returns undefined | E

  The value of the first element in the data structure.

  - Defined in src/data-structures/queue/deque.ts:101

### pollLast

- pollLast(): undefined | E

- The `pollLast()` function removes and returns the last element in a data structure.

  #### Returns undefined | E

  The value that was removed from the data structure.

  - Defined in src/data-structures/queue/deque.ts:122

Generated using TypeDoc