// Declarations for a typical list-node class of Strings
// File:    ListStringNode.java
// Based loosely on: C++ code list-class.h
// Author:  Henry M. Walker
// Date:    March 14, 2002; updated 26 January 26, 2020

package lists;

public class ListStringNode implements Comparable<ListStringNode>{

    protected String data;  // the information to be stored in the node
    protected ListStringNode next;// the pointer to the next ListStringNode

    // Constructors
    public ListStringNode (String startingData) {
        data = startingData;
        next = null;
    }

    public ListStringNode (String startingData, ListStringNode nextNode) {
        data = startingData;
        next = nextNode;
    }

    // extractors
    public String getData () {
        return data;
    }

    public ListStringNode getNext () {
        return next;
    }

    // modifiers
    public void setData (String newData) {
        data = newData;
    }

    public void setNext (ListStringNode newNext) {
        next = newNext;
    }

    public int compareTo (ListStringNode strNode) {
	return this.data.compareTo (strNode.data);
    }
    
} // ListStringNode
