PRQuadTree / src / Node.java
Node.java
Raw
/**
 * 
 * @author nickgrifasi
 * @version 10/11/21
 * Node class to be used in linked list. 
 * Refactored to deal with Point objects.
 */
public class Node {
    
    /**
     * Point object stored in node
     */
    private Point point;
    
    /**
     * next node
     */
    private Node next;
    
    /**
     * Constructor creates node, stores
     * point data
     * @param temp point to be stored
     */
    public Node(Point temp)
    {
        next = null;
        point = temp;
    }
    
    /**
     *  Retrieves next node
     *  @return node
     */
    public Node getNode()
    {
        return next; 
    }
    
    /**
     * Sets next node 
     * @param node to be mutated to next
     */
    public void setNode(Node node)
    {
        next = node;
    }

    /**
     * Retrieves point from node
     * @return Point data
     */
    public Point getPoint()
    {
        return point;
    }
    
    /**
     * Sets point in node
     * @param temp point for node to point to
     */
    public void setPoint(Point temp)
    {
        point = temp;
    }
}