USERKEY - The user's key.STOREKEY - The key in the data storage medium.public class Node<USERKEY,STOREKEY>
extends java.lang.Object
implements java.io.Serializable
NodeStore. Notice that a Node
does not posses any knowlede of the key it is stored under.
Only it's children or ancestor nodes.| Constructor and Description |
|---|
Node()
Create a Node that can store a single ancestor, child, and data object.
|
Node(int childCap)
Create a Node that can store a number of children, one data keys and one ancestor.
|
Node(int childCap,
int dataCap)
Create a Node that can store a number of children and data keys and has only one ancestor.
|
Node(int childCap,
int dataCap,
int ancestorsCap)
Create a Node.
|
| Modifier and Type | Method and Description |
|---|---|
java.util.List<STOREKEY> |
getAncestors() |
int |
getAncestorsCap() |
int |
getChildCap() |
java.util.List<STOREKEY> |
getChildren() |
java.util.List<USERKEY> |
getData() |
int |
getDataCap() |
boolean |
isAncestorsFull() |
boolean |
isChildrenFull() |
boolean |
isDataFull() |
boolean |
isEmpty()
Return true of this node has no data.
|
boolean |
isLeaf()
Return true if this node has no children.
|
boolean |
isRoot()
Return true of this node has no ancestors.
|
void |
setAncestorCap(int ancestorsCap) |
void |
setAncestors(java.util.List<STOREKEY> ancestors) |
void |
setChildCap(int childCap) |
void |
setChildren(java.util.List<STOREKEY> children) |
void |
setData(java.util.List<USERKEY> data) |
void |
setDataCap(int dataCap) |
java.lang.String |
toString() |
public Node()
public Node(int childCap)
childCap - The number of children this Node may have.public Node(int childCap,
int dataCap)
childCap - The number of children this Node may have.dataCap - The number of data entries this Node may have.public Node(int childCap,
int dataCap,
int ancestorsCap)
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.public java.util.List<USERKEY> getData()
public java.util.List<STOREKEY> getAncestors()
public java.util.List<STOREKEY> getChildren()
public int getDataCap()
public int getChildCap()
public int getAncestorsCap()
public boolean isDataFull()
public boolean isChildrenFull()
public boolean isAncestorsFull()
public void setData(java.util.List<USERKEY> data)
public void setChildren(java.util.List<STOREKEY> children)
public void setAncestors(java.util.List<STOREKEY> ancestors)
public void setDataCap(int dataCap)
public void setChildCap(int childCap)
public void setAncestorCap(int ancestorsCap)
public boolean isEmpty()
public boolean isLeaf()
public boolean isRoot()
public java.lang.String toString()
toString in class java.lang.Object