Structures_LinkedList_Double
[ class tree: Structures_LinkedList_Double ] [ index: Structures_LinkedList_Double ] [ all elements ]

Class: Structures_LinkedList_Double

Source Location: /Structures_LinkedList-0.2.2/Structures/LinkedList/Double.php

Class Overview

Structures_LinkedList_Single
   |
   --Structures_LinkedList_Double

The Structures_LinkedList_Double class represents a linked list structure composed of Structures_LinkedList_DoubleNode objects.


Author(s):

Variables

Methods


Child classes:

LinkListTester
The Structures_LinkedList_Double class represents a linked list structure composed of Structures_LinkedList_DoubleNode objects.

Inherited Variables

Inherited Methods

Class: Structures_LinkedList_Single

Structures_LinkedList_Single::__construct()
Structures_LinkedList_Single constructor
Structures_LinkedList_Single::appendNode()
Adds a Structures_LinkedList_SingleNode object to the end of the linked list.
Structures_LinkedList_Single::current()
Returns the current node in the linked list
Structures_LinkedList_Single::deleteNode()
Deletes a Structures_LinkedList_SingleNode from the list.
Structures_LinkedList_Single::end()
Sets the pointer for the linked list to the root node
Structures_LinkedList_Single::getTailNode()
Returns the tail node of the linked list.
Structures_LinkedList_Single::insertNode()
Inserts a Structures_LinkedList_SingleNode object into the linked list, based on a reference node that already exists in the list.
Structures_LinkedList_Single::key()
Stub for Iterator interface that simply returns the current node
Structures_LinkedList_Single::next()
Sets the pointer for the linked list to the next node and returns that node
Structures_LinkedList_Single::prependNode()
Adds a Structures_LinkedList_SingleNode object to the start of the linked list.
Structures_LinkedList_Single::previous()
Sets the pointer for the linked list to the previous node and returns that node
Structures_LinkedList_Single::rewind()
Sets the pointer for the linked list to the root node
Structures_LinkedList_Single::valid()
Stub for Iterator interface that simply returns the current node
Structures_LinkedList_Single::__destruct()
Structures_LinkedList_Single destructor

Class Details

[line 72]
The Structures_LinkedList_Double class represents a linked list structure composed of Structures_LinkedList_DoubleNode objects.


[ Top ]


Class Variables

$tail_node =

[line 79]

Tail node of the linked list
  • Access: protected



[ Top ]



Method Detail

__construct (Constructor)   [line 89]

Structures_LinkedList_Double __construct( [Structures_LinkedList_DoubleNode $root = null])

Structures_LinkedList_Double constructor

Overrides Structures_LinkedList_Single::__construct() (Structures_LinkedList_Single constructor)

Parameters:

Structures_LinkedList_DoubleNode   $root   —  root node for the linked list

[ Top ]

__destruct (Destructor)   [line 108]

void __destruct( )

Structures_LinkedList_Double destructor

If we do not destroy all of the references in the linked list, we will quickly run out of memory for large / complex structures.


Overrides Structures_LinkedList_Single::__destruct() (Structures_LinkedList_Single destructor)
[ Top ]

deleteNode   [line 244]

null deleteNode( Structures_LinkedList_DoubleNode $node)

Deletes a Structures_LinkedList_DoubleNode from the list.
  • Access: public

Overrides Structures_LinkedList_Single::deleteNode() (Deletes a Structures_LinkedList_SingleNode from the list.)

Parameters:

Structures_LinkedList_DoubleNode   $node   —  Node to delete.

[ Top ]

end   [line 139]

Structures_LinkedList_DoubleNode end( )

Sets the pointer for the linked list to its last node
  • Return: last node in the linked list
  • Access: public

Overrides Structures_LinkedList_Single::end() (Sets the pointer for the linked list to the root node)
[ Top ]

getTailNode   [line 230]

bool getTailNode( )

Returns the tail node of the linked list.

This is a cheap operation for a doubly-linked list.

  • Return: Success or failure
  • Access: protected

Overrides Structures_LinkedList_Single::getTailNode() (Returns the tail node of the linked list.)
[ Top ]

insertNode   [line 178]

bool insertNode( Structures_LinkedList_DoubleNode $new_node, Structures_LinkedList_DoubleNode $existing_node, [bool $before = false])

Inserts a Structures_LinkedList_DoubleNode object into the linked list, based on a reference node that already exists in the list.
  • Return: Success or failure
  • Access: public

Overrides Structures_LinkedList_Single::insertNode() (Inserts a Structures_LinkedList_SingleNode object into the linked list, based on a reference node that already exists in the list.)

Parameters:

Structures_LinkedList_DoubleNode   $new_node   —  New node to add to the list
Structures_LinkedList_DoubleNode   $existing_node   —  Reference position node
bool   $before   —  Insert new node before or after the existing node

[ Top ]

previous   [line 157]

Structures_LinkedList_DoubleNode previous( )

Sets the pointer for the linked list to the previous node and returns that node
  • Return: previous node in the linked list
  • Access: public

Overrides Structures_LinkedList_Single::previous() (Sets the pointer for the linked list to the previous node and returns that node)
[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:38:21 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.