C# Class csCommon.Utils.Collections.DoubleLinkListIndexNode

This class is used for linked objects in a 2 way linked list, which are also all held in a dictionary. The purpose of this class is to allow the position of items in a dictionary to be quickly determined.
Exibir arquivo Open project: TNOCS/csTouch

Public Properties

Property Type Description
Index int
Next DoubleLinkListIndexNode
Previous DoubleLinkListIndexNode

Public Methods

Method Description
DoubleLinkListIndexNode ( DoubleLinkListIndexNode previous, DoubleLinkListIndexNode next )

Constructor for when a node is inserted into the middle of the list.

DoubleLinkListIndexNode ( DoubleLinkListIndexNode previous, int index )

Constructor for when a node is added to the end of the list.

Remove ( ) : void

This function effectively removes this node from the linked list, and decrements the position index of all the nodes that follow it. It removes the node by changing the nodes that come before and after it to point to each other, thus bypassing this node.

Private Methods

Method Description
DecrementForward ( ) : void

This recursive function decrements the position index of all the nodes in front of this node. Used for when a node is removed from a list.

IncrementForward ( ) : void

This recursive function decrements the position index of all the nodes in front of this node. Used for when a node is inserted into a list.

Method Details

DoubleLinkListIndexNode() public method

Constructor for when a node is inserted into the middle of the list.
public DoubleLinkListIndexNode ( DoubleLinkListIndexNode previous, DoubleLinkListIndexNode next )
previous DoubleLinkListIndexNode
next DoubleLinkListIndexNode

DoubleLinkListIndexNode() public method

Constructor for when a node is added to the end of the list.
public DoubleLinkListIndexNode ( DoubleLinkListIndexNode previous, int index )
previous DoubleLinkListIndexNode
index int

Remove() public method

This function effectively removes this node from the linked list, and decrements the position index of all the nodes that follow it. It removes the node by changing the nodes that come before and after it to point to each other, thus bypassing this node.
public Remove ( ) : void
return void

Property Details

Index public_oe property

The position within the linked list
public int Index
return int

Next public_oe property

The next node in the linked list
public DoubleLinkListIndexNode,csCommon.Utils.Collections Next
return DoubleLinkListIndexNode

Previous public_oe property

The previous node in the linked list
public DoubleLinkListIndexNode,csCommon.Utils.Collections Previous
return DoubleLinkListIndexNode