import java.util.List;

/**
 * This class represents the node of the GDI2 B-Tree
 */
public class GDI2BTreeNode 
{
	private GDI2BTreeNode predecessor;		// the parent node
	private List<String> data;				// the list of keys (the data)
	private List<GDI2BTreeNode> children;	// the list of children nodes
	private boolean leaf;					// leaf or no leaf
	
	// TODO: implement the getter/setter methods, e.g., getPredecessor() and setPredecessor()
	
	// TODO: Specify other private data, variables	
	// TODO: Implement other necessary methods, e.g., a method to sort the keys
	
	/**
	 * Constructor
	 * @param parent the predecessor node (if the current node is root, then parent = null)
	 */
	public GDI2BTreeNode(GDI2BTreeNode parent)
	{
		// TODO: implement the constructor
		// set predecessor (= parent)
		// initialise data
		// initialise children
	}
	/**
	 * Checks if the node has keys/data
	 * @return true - if the node has keys/data, otherwise false
	 */
	public boolean hasKeys()
	{
		// TODO: implement this method
		return true;
	}
	/**
	 * Checks if the node has children
	 * @return true - if the node has children, otherwise false
	 */
	public boolean hasChildren()
	{
		// TODO: implement this method
		return false;
	}
	/* (non-Javadoc)
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString()
	{
		// TODO: implement this method
		return "";
	}
	/**
	 * @return the data
	 */
	public List<String> getData() {
		return data;
	}
	/**
	 * @param data the data to set
	 */
	public void setData(List<String> data) {
		this.data = data;
	}
	/**
	 * @return the children
	 */
	public List<GDI2BTreeNode> getChildren() {
		return children;
	}
	/**
	 * @param children the children to set
	 */
	public void setChildren(List<GDI2BTreeNode> children) {
		this.children = children;
	}
	/**
	 * Checks if the node is a leaf
	 * @return true - if the node is a leaf, otherwise false
	 */
	public boolean isLeaf()
	{
		return this.leaf;
	}
	/**
	 * @param leaf the leaf to set
	 */
	public void setLeaf(boolean leaf) {
		this.leaf = leaf;
	}
}
