Created
April 28, 2016 09:52
-
-
Save LukeMcNemee/27328b1feb3fc9ac7623bd2c49df33e7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Objects; | |
/* | |
* To change this license header, choose License Headers in Project Properties. | |
* To change this template file, choose Tools | Templates | |
* and open the template in the editor. | |
*/ | |
/** | |
* | |
* @author lukemcnemee | |
*/ | |
public class Member <T> { | |
@Override | |
public int hashCode() { | |
int hash = 7; | |
hash = 17 * hash + Objects.hashCode(this.data); | |
return hash; | |
} | |
@Override | |
public boolean equals(Object obj) { | |
if (obj == null) { | |
return false; | |
} | |
if (getClass() != obj.getClass()) { | |
return false; | |
} | |
final Member<?> other = (Member<?>) obj; | |
if (!Objects.equals(this.data, other.data)) { | |
return false; | |
} | |
return true; | |
} | |
public Member(T data) { | |
this.data = data; | |
} | |
private Member previous; | |
private Member next; | |
private T data; | |
public Member getPrevious() { | |
return previous; | |
} | |
public void setPrevious(Member previous) { | |
this.previous = previous; | |
} | |
public Member getNext() { | |
return next; | |
} | |
public void setNext(Member next) { | |
this.next = next; | |
} | |
@Override | |
public String toString() { | |
return "Member{" + "data=" + data + '}'; | |
} | |
public T getData() { | |
return data; | |
} | |
public void setData(T data) { | |
this.data = data; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment