Skip to content

Latest commit

 

History

History
193 lines (152 loc) · 11 KB

LinkedListViewSequence.md

File metadata and controls

193 lines (152 loc) · 11 KB

LinkedListViewSequence

Linked-list based implementation of a view-sequence which fixes several issues in the stock famo.us ViewSequence.

LinkedListViewSequence ⏏

Kind: Exported class

new LinkedListViewSequence(options)

Param Type Description
options Object Configurable options.

linkedListViewSequence.getHead() ⇒ LinkedListViewSequence

Get head node.

Kind: instance method of LinkedListViewSequence
Returns: LinkedListViewSequence - head node.

linkedListViewSequence.getTail() ⇒ LinkedListViewSequence

Get tail node.

Kind: instance method of LinkedListViewSequence
Returns: LinkedListViewSequence - tail node.

linkedListViewSequence.getPrevious() ⇒ LinkedListViewSequence

Get previous node.

Kind: instance method of LinkedListViewSequence
Returns: LinkedListViewSequence - previous node.

linkedListViewSequence.getNext() ⇒ LinkedListViewSequence

Get next node.

Kind: instance method of LinkedListViewSequence
Returns: LinkedListViewSequence - next node.

linkedListViewSequence.get() ⇒ Renderable

Gets the value of this node.

Kind: instance method of LinkedListViewSequence
Returns: Renderable - surface/view

linkedListViewSequence.set(value) ⇒ LinkedListViewSequence

Sets the value of this node.

Kind: instance method of LinkedListViewSequence
Returns: LinkedListViewSequence - this

Param Type Description
value Renderable surface/view

linkedListViewSequence.getIndex() ⇒ Number

Get the index of the node.

Kind: instance method of LinkedListViewSequence
Returns: Number - Index of node.

linkedListViewSequence.toString() ⇒ String

Get human readable string verion of the node.

Kind: instance method of LinkedListViewSequence
Returns: String - node as a human readable string

linkedListViewSequence.indexOf(item) ⇒ Number

Finds the index of a given render-node.

Kind: instance method of LinkedListViewSequence
Returns: Number - Index or -1 when not found.

Param Type Description
item Renderable Render-node to find.

linkedListViewSequence.findByIndex(index) ⇒ LinkedListViewSequence

Finds the view-sequence item at the given index.

Kind: instance method of LinkedListViewSequence
Returns: LinkedListViewSequence - View-sequence node or undefined.

Param Type Description
index Number 0-based index.

linkedListViewSequence.findByValue(value) ⇒ LinkedListViewSequence

Finds the view-sequence node by the given renderable.

Kind: instance method of LinkedListViewSequence
Returns: LinkedListViewSequence - View-sequence node or undefined.

Param Type Description
value Renderable Render-node to search for.

linkedListViewSequence.insert(index, renderNode) ⇒ LinkedListViewSequence

Inserts an item into the view-sequence.

Kind: instance method of LinkedListViewSequence
Returns: LinkedListViewSequence - newly inserted view-sequence node.

Param Type Description
index Number 0-based index (-1 inserts at the tail).
renderNode Renderable Renderable to insert.

linkedListViewSequence.remove(sequence) ⇒ LinkedListViewSequence

Removes the view-sequence item at the given index.

Kind: instance method of LinkedListViewSequence
Returns: LinkedListViewSequence - New current view-sequence node to display.

Param Type Description
sequence LinkedListViewSequence Node to remove

linkedListViewSequence.getLength() ⇒ Number

Gets the number of items in the view-sequence.

Kind: instance method of LinkedListViewSequence
Returns: Number - length.

linkedListViewSequence.clear() ⇒ LinkedListViewSequence

Removes all items.

Kind: instance method of LinkedListViewSequence
Returns: LinkedListViewSequence - Last remaining view-sequence node.

linkedListViewSequence.unshift(renderNode) ⇒ LinkedListViewSequence

Inserts an item at the beginning of the view-sequence.

Kind: instance method of LinkedListViewSequence
Returns: LinkedListViewSequence - newly inserted view-sequence node.

Param Type Description
renderNode Renderable Renderable to insert.

linkedListViewSequence.push(renderNode) ⇒ LinkedListViewSequence

Inserts an item at the end of the view-sequence.

Kind: instance method of LinkedListViewSequence
Returns: LinkedListViewSequence - newly inserted view-sequence node.

Param Type Description
renderNode Renderable Renderable to insert.

linkedListViewSequence.swap(index, index2) ⇒ LinkedListViewSequence

Swaps the values of two view-sequence nodes.

Kind: instance method of LinkedListViewSequence
Returns: LinkedListViewSequence - this

Param Type Description
index Number Index of the first item to swap.
index2 Number Index of item to swap with.