1 | export class LinkNode<T>{
|
2 | constructor(private value: T, private next: LinkNode<T> = null){
|
3 |
|
4 | }
|
5 |
|
6 | public get Value(){
|
7 | return this.value;
|
8 | }
|
9 |
|
10 | public get Next(){
|
11 | return this.next;
|
12 | }
|
13 |
|
14 | public setValue(value: T){
|
15 | this.value = value;
|
16 | }
|
17 |
|
18 | public setNext(node: LinkNode<T>){
|
19 | this.next = node;
|
20 | }
|
21 |
|
22 | public toString(){
|
23 | return `${this.value}`;
|
24 | }
|
25 | }
|