ZQN
2024-06-17 b1ff19545212508d3f65741ab889f0b6df82a511
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
package com.project.common.core.absclasses;
 
import com.project.common.core.interfaces.ILinkNode;
import lombok.Data;
import lombok.NoArgsConstructor;
 
@Data
@NoArgsConstructor
public class BaseLinkNode<T> implements ILinkNode<T>
{
 
 
    private T data;
 
    private BaseLinkNode<T> pre;
 
    private BaseLinkNode<T> suf;
 
    private Boolean hasPre = false;
 
    private Boolean hasSuf = false;
 
 
    public BaseLinkNode<T> getPre() {
        return this.getHasPre() ? pre : null;
    }
 
    public BaseLinkNode<T> getSuf() {
        return this.getHasSuf() ? suf : null;
    }
 
    public Boolean isHead(){
        return this.pre == null;
    }
 
    public Boolean isLast(){
        return this.suf == null;
    }
 
 
    public Boolean getHasPre()
    {
 
        return this.pre != null || this.hasPre;
    }
 
    public Boolean getHasSuf()
    {
 
        return this.suf != null || this.hasSuf;
    }
 
    public boolean equals(final Object o)
    {
        if (o == this) {
            return true;
        } else if (!(o instanceof BaseLinkNode)) {
            return false;
        } else {
            BaseLinkNode<?> other = (BaseLinkNode)o;
            if (!other.canEqual(this)) {
                return false;
            } else {
 
                Object this$pre = this.getPre();
                Object other$pre = other.getPre();
                if (this$pre == null) {
                    if (other$pre != null) {
                        return false;
                    }
                } else if (!this$pre.equals(other$pre)) {
                    return false;
                }
 
                Object this$suf = this.getSuf();
                Object other$suf = other.getSuf();
                if (this$suf == null) {
                    if (other$suf != null) {
                        return false;
                    }
                } else if (!this$suf.equals(other$suf)) {
                    return false;
                }
 
                Object this$data = this.getData();
                Object other$data = other.getData();
                if (this$data == null) {
                    if (other$data != null) {
                        return false;
                    }
                } else if (!this$data.equals(other$data)) {
                    return false;
                }
 
                return true;
            }
        }
    }
 
    protected boolean canEqual(final Object other)
    {
 
        return other instanceof BaseLinkNode;
    }
 
    public int hashCode()
    {
        boolean PRIME = true;
        int result = 1;
        Object $pre = this.getPre();
        result = result * 59 + ($pre == null ? 43 : $pre.hashCode());
        Object $suf = this.getSuf();
        result = result * 59 + ($suf == null ? 43 : $suf.hashCode());
        Object $data = this.getData();
        result = result * 59 + ($data == null ? 43 : $data.hashCode());
        return result;
    }
 
    public String toString()
    {
        return "BaseLinkNode("
                + "data=" + this.getData() + ")";
//                + ", pre=" + this.getPre()
//                + ", suf=" + this.getSuf() + ")";
    }
 
 
 
}