Class Node<USERKEY,​STOREKEY>

  • Type Parameters:
    USERKEY - The user's key.
    STOREKEY - The key in the data storage medium.
    All Implemented Interfaces:
    java.io.Serializable

    public class Node<USERKEY,​STOREKEY>
    extends java.lang.Object
    implements java.io.Serializable
    The basic object that is persisted to a large distributed storage via a NodeStore. Notice that a Node does not posses any knowlede of the key it is stored under. Only it's children or ancestor nodes.
    See Also:
    Serialized Form
    • Constructor Detail

      • Node

        public Node()
        Create a Node that can store a single ancestor, child, and data object.
      • Node

        public Node​(int childCap)
        Create a Node that can store a number of children, one data keys and one ancestor.
        Parameters:
        childCap - The number of children this Node may have.
      • Node

        public Node​(int childCap,
                    int dataCap)
        Create a Node that can store a number of children and data keys and has only one ancestor.
        Parameters:
        childCap - The number of children this Node may have.
        dataCap - The number of data entries this Node may have.
      • Node

        public Node​(int childCap,
                    int dataCap,
                    int ancestorsCap)
        Create a Node.
        Parameters:
        childCap - The number of children this Node may have.
        dataCap - The number of data elements this Node may have.
        ancestorsCap - The number of ancestors this node may have.
    • Method Detail

      • getData

        public java.util.List<USERKEY> getData()
      • getAncestors

        public java.util.List<STOREKEY> getAncestors()
      • getChildren

        public java.util.List<STOREKEY> getChildren()
      • getDataCap

        public int getDataCap()
      • getChildCap

        public int getChildCap()
      • getAncestorsCap

        public int getAncestorsCap()
      • isDataFull

        public boolean isDataFull()
      • isChildrenFull

        public boolean isChildrenFull()
      • isAncestorsFull

        public boolean isAncestorsFull()
      • setData

        public void setData​(java.util.List<USERKEY> data)
      • setChildren

        public void setChildren​(java.util.List<STOREKEY> children)
      • setAncestors

        public void setAncestors​(java.util.List<STOREKEY> ancestors)
      • setDataCap

        public void setDataCap​(int dataCap)
      • setChildCap

        public void setChildCap​(int childCap)
      • setAncestorCap

        public void setAncestorCap​(int ancestorsCap)
      • isEmpty

        public boolean isEmpty()
        Return true of this node has no data.
        Returns:
        true of this node has no data.
      • isLeaf

        public boolean isLeaf()
        Return true if this node has no children.
        Returns:
        true if this node has no children.
      • isRoot

        public boolean isRoot()
        Return true of this node has no ancestors.
        Returns:
        true if this node has no ancestors.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object