AWS Amplify API
AWS Amplify Home
Options
All

- Public
- Public/Protected
- All

Inherited Externals Only exported
Menu

double linked list plus a hash table inside each key in the cache stored as a node in the list recently visited node will be rotated to the head so the Last Recently Visited node will be at the tail

member

  head - dummy head of the linked list

member

  tail - dummy tail of the linked list

member

  hashtable - the hashtable which maps cache key to list node

member

  length - length of the list

### Hierarchy

- CacheList

## Index

### Constructors

- constructor

### Methods

- clearList
- containsKey
- getKeys
- getLastItem
- getSize
- insertItem
- isEmpty
- isHeadNode
- isTailNode
- refresh
- removeItem

## Constructors

### constructor

- new CacheList(): CacheList

- - Defined in cache/src/Utils/CacheList.ts:41

  initialization

  #### Returns CacheList

## Methods

### clearList

- clearList(): void

- - Defined in cache/src/Utils/CacheList.ts:151

  clean up the list and hashtable

  #### Returns void

### containsKey

- containsKey(key: string): boolean

- - Defined in cache/src/Utils/CacheList.ts:144

  #### Parameters

  - ##### key: string

  #### Returns boolean

  true if the key is in the hashtable

### getKeys

- getKeys(): string[]

- - Defined in cache/src/Utils/CacheList.ts:165

  #### Returns string[]

  all keys in the hashtable

### getLastItem

- getLastItem(): string

- - Defined in cache/src/Utils/CacheList.ts:119

  #### Returns string

  the LAST Recently Visited key

### getSize

- getSize(): number

- - Defined in cache/src/Utils/CacheList.ts:136

  #### Returns number

  length of the list

### insertItem

- insertItem(key: string): void

- - Defined in cache/src/Utils/CacheList.ts:110

  insert new node to the head and add it in the hashtable

  #### Parameters

  - ##### key: string

    the key of the node

  #### Returns void

### isEmpty

- isEmpty(): boolean

- - Defined in cache/src/Utils/CacheList.ts:90

  #### Returns boolean

  true if list is empty

### isHeadNode

- isHeadNode(key: string): boolean

- - Defined in cache/src/Utils/CacheList.ts:175

  mainly for test

  #### Parameters

  - ##### key: string

  #### Returns boolean

  true if key is the head node

### isTailNode

- isTailNode(key: string): boolean

- - Defined in cache/src/Utils/CacheList.ts:186

  mainly for test

  #### Parameters

  - ##### key: string

  #### Returns boolean

  true if key is the tail node

### refresh

- refresh(key: string): void

- - Defined in cache/src/Utils/CacheList.ts:99

  refresh node so it is rotated to the head

  #### Parameters

  - ##### key: string

    key of the node

  #### Returns void

### removeItem

- removeItem(key: string): void

- - Defined in cache/src/Utils/CacheList.ts:127

  remove the cache key from the list and hashtable

  #### Parameters

  - ##### key: string

    the key of the node

  #### Returns void