me.edwards.des.block
Class BlockChain.Node

java.lang.Object
  extended by me.edwards.des.block.BlockChain.Node
Enclosing class:
BlockChain

public class BlockChain.Node
extends java.lang.Object

Represents a tree node in the BlockChain

Created on: Dec 21, 2015 at 5:20:30 PM

Author:
Matthew Edwards

Field Summary
private  Block block
           
private  int height
           
private  BlockChain.Node parent
           
 
Constructor Summary
BlockChain.Node()
           
 
Method Summary
 Block getBlock()
          Returns the Block contained in this node.
 int getHeight()
          Returns the height of this node in the BlockChain.
 BlockChain.Node getParent()
          Returns the parent node.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

parent

private BlockChain.Node parent

height

private int height

block

private Block block
Constructor Detail

BlockChain.Node

public BlockChain.Node()
Method Detail

getParent

public BlockChain.Node getParent()
Returns the parent node.

Returns:
Parent node of this node. If this node is at the bottom of the chain, the parent node is null

getHeight

public int getHeight()
Returns the height of this node in the BlockChain.

Returns:
Height of this node. The node at the bottom of the chain has a height of 0

getBlock

public Block getBlock()
Returns the Block contained in this node.

Returns:
Block contained in this node