Index
Overview


Hello, I'm DLNode. If you expand my name out it means "doubly linked node".

Please note that I tend to use "data" and "element" interchangeably.

Here is a video on me...

I am the building blocks of linked lists (and many other data structures).

I am called "doubly linked" because I have a link pointer back to the previous node and a link pointer forward to the next node. A link is simply an instance variable as we'll see.

In this section we will use the term "Node" or "node" as an abbreviation for a DLNode.

Concepts (and Structure)


Node Has Data
My primary job is to hold data (an element). My data may be any type -- City, Person, etc.
Node Has Links
I have two links. One to my previous node, and one to my next node.

My links allow object users to navigate to the previous or next node.
Complete Node
Here is a complete sketch of me (a proud Node). I am doubly linked and I hold data. I really do!


Examples - With Data


Node With City Data
Here I am (a dignified node) with a City element.
Node With Person Data
Here I am (an esteemed node) with a Person element.
Node With Integer Data
Here I am with an Integer element.


End Nodes


First Node
When I am the first node in a list, my "prevNode" link is null.
Last Node
When I am the last node in a list, my "nextNode" link is null.


Object Diagram


Object Diagram
And now I present to you an object diagram of myself -- pleasantly simple isn't it?