choco.kernel.memory
Class IStateBinaryTree.Node

java.lang.Object
  extended by choco.kernel.memory.IStateBinaryTree.Node
Enclosing interface:
IStateBinaryTree

public static class IStateBinaryTree.Node
extends Object

Inner class representing a node in the binary tree a node is an interval


Field Summary
 IStateBinaryTree.Node father
          the father of this node in the tree
 int inf
          the lower bound of the node
 int infStamp
          the timestamp of the lwer bound
 IStateBinaryTree.Node leftNode
          the left son of this node in the tree
protected  StoredBinaryTreeTrail myTrail
           
 IStateBinaryTree.Node rightNode
          the right son of this node in the tree
 int sup
          the upper bound of the node
 int supStamp
          the timestamp of the upper bound
 IStateBinaryTree tree
          the binary tree the node belongs to
 
Constructor Summary
IStateBinaryTree.Node(IStateBinaryTree tree, int inf, int sup)
          Construct a new node (interval)
 
Method Summary
 void _setInf(int newInf, int infStamp)
          set a new lower bound to the node, without saving it used for trailing purpose
 void _setSup(int newSup, int supStamp)
          set a new upper bound to the node, without saving it used for trailing purpose
 boolean contains(int value)
          Check wether a value is in the interval represented by thiis node
 int getInf()
          Gets the lower bound of the node
 int getSize()
          gets the size of the interval represented by this node
 int getSup()
          Gets the upper bound of the node
 void setInf(int newInf)
          set a new lower bound to the node, and saving it if needed
 void setSup(int newSup)
          set a new upper bound to the node, and saving it if needed used for trailing purpose
 String toString()
          return a String representing the node as an interval
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

inf

public int inf
the lower bound of the node


sup

public int sup
the upper bound of the node


infStamp

public int infStamp
the timestamp of the lwer bound


supStamp

public int supStamp
the timestamp of the upper bound


tree

public IStateBinaryTree tree
the binary tree the node belongs to


father

public IStateBinaryTree.Node father
the father of this node in the tree


leftNode

public IStateBinaryTree.Node leftNode
the left son of this node in the tree


rightNode

public IStateBinaryTree.Node rightNode
the right son of this node in the tree


myTrail

protected final StoredBinaryTreeTrail myTrail
Constructor Detail

IStateBinaryTree.Node

public IStateBinaryTree.Node(IStateBinaryTree tree,
                             int inf,
                             int sup)
Construct a new node (interval)

Parameters:
tree - the tree the node belongs to
inf - the lower bound of this interval
sup - the upper bound of this interval
Method Detail

contains

public boolean contains(int value)
Check wether a value is in the interval represented by thiis node

Parameters:
value - integer value to be check
Returns:
true if the value is in the interval, false otherwise

getSize

public int getSize()
gets the size of the interval represented by this node

Returns:
integer value of the size

_setInf

public void _setInf(int newInf,
                    int infStamp)
set a new lower bound to the node, without saving it used for trailing purpose

Parameters:
newInf - the new value of the lower bound
infStamp - the new timestamp of the lower bound

setInf

public void setInf(int newInf)
set a new lower bound to the node, and saving it if needed

Parameters:
newInf - the new value of the lower bound

_setSup

public void _setSup(int newSup,
                    int supStamp)
set a new upper bound to the node, without saving it used for trailing purpose

Parameters:
newSup - the new value of the upper bound
supStamp - the new timestamp of the upper bound

setSup

public void setSup(int newSup)
set a new upper bound to the node, and saving it if needed used for trailing purpose

Parameters:
newSup - the new value of the upper bound

getInf

public int getInf()
Gets the lower bound of the node

Returns:
the lower bound

getSup

public int getSup()
Gets the upper bound of the node

Returns:
the upper bound

toString

public String toString()
return a String representing the node as an interval

Overrides:
toString in class Object
Returns:
a new string


Copyright © 2012. All Rights Reserved.