algorithms-sandbox/sorting/java/src/be/brainbaking/lists/SomeLinkedObject.java

30 lines
533 B
Java
Raw Normal View History

2018-03-26 17:35:42 +02:00
package be.brainbaking.lists;
public class SomeLinkedObject<T> {
private final SomeLinkedObject<T> next;
private final T key;
public SomeLinkedObject<T> getNext() {
return next;
}
@Override
public String toString() {
return "[" + key + "]";
}
public T getKey() {
return key;
}
public SomeLinkedObject(T key) {
this(null, key);
}
public SomeLinkedObject(SomeLinkedObject<T> next, T key) {
this.next = next;
this.key = key;
}
}