mirror of
https://github.com/zach-sb/SENG1120-Assignment-1.git
synced 2025-11-09 05:17:38 +11:00
73 lines
818 B
C++
73 lines
818 B
C++
/*
|
|
Name: Node.cpp
|
|
Author: Zach Seibel-Barnes
|
|
Student Number: c3262201
|
|
Last Modified: 16/09/2020
|
|
|
|
Description:
|
|
*/
|
|
|
|
#include "Node.h"
|
|
|
|
//Construct the Node Class
|
|
Node::Node(const valueType& initialData, Node* nextLink, Node* prevLink)
|
|
{
|
|
data=initialData;
|
|
next=nextLink;
|
|
prev=prevLink;
|
|
}
|
|
|
|
Node::Node ()
|
|
{
|
|
next = NULL;
|
|
prev = NULL;
|
|
}
|
|
|
|
Node::~Node()
|
|
{
|
|
}
|
|
|
|
|
|
|
|
//Getters
|
|
|
|
Node::valueType Node::getData() const
|
|
{
|
|
return data;
|
|
}
|
|
//Next
|
|
Node* Node::getNext()
|
|
{
|
|
return next;
|
|
}
|
|
|
|
const Node* Node::getNext() const
|
|
{
|
|
return next;
|
|
}
|
|
//Prev
|
|
Node* Node::getPrev()
|
|
{
|
|
return prev;
|
|
}
|
|
|
|
const Node* Node::getPrev() const
|
|
{
|
|
return prev;
|
|
}
|
|
|
|
//Setters
|
|
void Node::setData(const valueType& newData)
|
|
{
|
|
data = newData;
|
|
}
|
|
|
|
void Node::setNext(Node* nextPtr)
|
|
{
|
|
next = nextPtr;
|
|
}
|
|
|
|
void Node::setPrev(Node* prevPtr)
|
|
{
|
|
prev = prevPtr;
|
|
} |