|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectchoco.kernel.memory.trailing.StoredBinaryTree
public final class StoredBinaryTree
Created by IntelliJ IDEA. User: julien Date: Apr 24, 2008 Time: 1:27:38 PM
Nested Class Summary | |
---|---|
protected static class |
StoredBinaryTree.TreeIterator
|
Nested classes/interfaces inherited from interface choco.kernel.memory.IStateBinaryTree |
---|
IStateBinaryTree.Node |
Field Summary | |
---|---|
protected StoredBinaryTreeTrail |
myTrail
|
Fields inherited from interface choco.kernel.memory.IStateBinaryTree |
---|
ADD, INF, LOGGER, REM, SUP |
Constructor Summary | |
---|---|
StoredBinaryTree(EnvironmentTrailing anEnvironment,
int a,
int b)
|
Method Summary | |
---|---|
void |
add(int a,
int b)
add a new interval [a,b] in the tree |
void |
add(IStateBinaryTree.Node n)
Add a node in the tree |
void |
add(IStateBinaryTree.Node n,
boolean save)
Add a node in the tree and save the operation if requested |
IStateBinaryTree.Node |
find(int value)
finds the node which contains the given value |
EnvironmentTrailing |
getEnvironment()
Gets the Environment associated with this tree |
IStateBinaryTree.Node |
getFirstNode()
Gets the node containing the lowest value in the tree |
DisposableIntIterator |
getIterator()
gets an iterator over the value in the tree |
IStateBinaryTree.Node |
getLastNode()
Gets the node containing the greatest value in the tree |
IStateBinaryTree.Node |
getRoot()
Gets the root of the tree |
int |
getSize()
Computes the size of the tree i.e. the number of value contained in the tree |
IStateBinaryTree.Node |
nextNode(int value)
gets the node that contains the next integer in the tree |
IStateBinaryTree.Node |
nextNode(IStateBinaryTree.Node n)
gets the next node of the given one |
IStateBinaryTree.Node |
prevNode(int value)
gets the node that contains the previous integer in the tree |
IStateBinaryTree.Node |
prevNode(IStateBinaryTree.Node n)
gets the previous node of the given one |
static void |
print(IStateBinaryTree b)
|
boolean |
remove(int value)
Remove the given value from the tree i.e. updates the tree so that contains(value) would return false; |
void |
remove(IStateBinaryTree.Node n)
Remove a node from the tree |
void |
remove(IStateBinaryTree.Node n,
boolean save)
Remove a node from the tree, and save the operation if requested |
String |
toDotty()
get the tree in dot format |
String |
toDotty(IStateBinaryTree.Node n)
|
List<IStateBinaryTree.Node> |
toList()
|
String |
toListString()
|
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected final StoredBinaryTreeTrail myTrail
Constructor Detail |
---|
public StoredBinaryTree(EnvironmentTrailing anEnvironment, int a, int b)
Method Detail |
---|
public int getSize()
IStateBinaryTree
getSize
in interface IStateBinaryTree
public IStateBinaryTree.Node find(int value)
IStateBinaryTree
find
in interface IStateBinaryTree
value
- the value to be found
public IStateBinaryTree.Node nextNode(int value)
IStateBinaryTree
nextNode
in interface IStateBinaryTree
value
- the value whose next is to be searched
public IStateBinaryTree.Node prevNode(int value)
IStateBinaryTree
prevNode
in interface IStateBinaryTree
value
- the value whose previous is to be searched
public void add(IStateBinaryTree.Node n)
IStateBinaryTree
add
in interface IStateBinaryTree
n
- the node to be addedpublic void remove(IStateBinaryTree.Node n)
IStateBinaryTree
remove
in interface IStateBinaryTree
n
- the node to be removed;public void remove(IStateBinaryTree.Node n, boolean save)
IStateBinaryTree
remove
in interface IStateBinaryTree
n
- the node to be removedsave
- true if the removal is to be stacked in the trailpublic void add(int a, int b)
IStateBinaryTree
add
in interface IStateBinaryTree
a
- the lower boundb
- the upper boundpublic void add(IStateBinaryTree.Node n, boolean save)
IStateBinaryTree
add
in interface IStateBinaryTree
n
- the node to be addedsave
- true id the addition is to be stacked in the trailpublic IStateBinaryTree.Node getRoot()
IStateBinaryTree
getRoot
in interface IStateBinaryTree
public IStateBinaryTree.Node prevNode(IStateBinaryTree.Node n)
IStateBinaryTree
prevNode
in interface IStateBinaryTree
n
- the reference node
public IStateBinaryTree.Node nextNode(IStateBinaryTree.Node n)
IStateBinaryTree
nextNode
in interface IStateBinaryTree
n
- the reference node
public boolean remove(int value)
IStateBinaryTree
remove
in interface IStateBinaryTree
value
- the value to be removed
public EnvironmentTrailing getEnvironment()
IStateBinaryTree
getEnvironment
in interface IStateBinaryTree
public IStateBinaryTree.Node getFirstNode()
IStateBinaryTree
getFirstNode
in interface IStateBinaryTree
public IStateBinaryTree.Node getLastNode()
IStateBinaryTree
getLastNode
in interface IStateBinaryTree
public String toString()
toString
in interface IStateBinaryTree
toString
in class Object
public List<IStateBinaryTree.Node> toList()
public String toListString()
public final DisposableIntIterator getIterator()
IStateBinaryTree
getIterator
in interface IStateBinaryTree
public String toDotty()
IStateBinaryTree
toDotty
in interface IStateBinaryTree
public String toDotty(IStateBinaryTree.Node n)
public static void print(IStateBinaryTree b)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |