Class | LinkedList
In: | lib/facets/more/linkedlist.rb
Parent: | Object

## LinkedList

LinkedList implements a simple doubly linked list with efficient hash-like element access.

This is a simple linked list implementation with efficient random access of data elements. It was inspired by George Moscovitis’ LRUCache implementation found in Facets 1.7.30, but unlike the linked list in that cache, this one does not require the use of a mixin on any class to be stored. The linked list provides the push, pop, shift, unshift, first, last, delete and length methods which work just like their namesakes in the Array class, but it also supports setting and retrieving values by key, just like a hash.

### Methods

[] []= delete each empty? first last length new pop push queue shift to_a unshift

### Included Modules

Enumerable

### Classes and Modules

Class LinkedList::Node

### Public Class methods

new()

### Public Instance methods

[](v)
[]=(k,v)
delete(k)
each() {|n.key,n.value| ...}
empty?()
first()
last()
length()
pop()
push(v)
queue()
shift()
to_a()
unshift(v)

[Validate]