|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IStateBinaryTree
Created by IntelliJ IDEA. User: julien Date: Apr 25, 2008 Time: 9:42:15 AM Interface for a backtrackable binary tree of integer intervals
Nested Class Summary | |
---|---|
static class |
IStateBinaryTree.Node
Inner class representing a node in the binary tree a node is an interval |
Field Summary | |
---|---|
static int |
ADD
static integer representing an operation over a binary tree ADD, a new interval has been added in the tree |
static int |
INF
static integer representing an operation over a binary tree INF, a lower bound of an interval has been modified |
static Logger |
LOGGER
|
static int |
REM
static integer representing an operation over a binary tree REM, an interval has been removed from the tree |
static int |
SUP
static integer representing an operation over a binary tree SUP, an upper bound of an interval has been modified |
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 |
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 |
toString()
|
Field Detail |
---|
static final Logger LOGGER
static final int INF
static final int SUP
static final int ADD
static final int REM
Method Detail |
---|
int getSize()
IStateBinaryTree.Node find(int value)
value
- the value to be found
void remove(IStateBinaryTree.Node n)
n
- the node to be removed;void remove(IStateBinaryTree.Node n, boolean save)
n
- the node to be removedsave
- true if the removal is to be stacked in the trailvoid add(int a, int b)
a
- the lower boundb
- the upper boundvoid add(IStateBinaryTree.Node n)
n
- the node to be addedvoid add(IStateBinaryTree.Node n, boolean save)
n
- the node to be addedsave
- true id the addition is to be stacked in the trailIStateBinaryTree.Node getRoot()
boolean remove(int value)
value
- the value to be removed
EnvironmentTrailing getEnvironment()
IStateBinaryTree.Node getFirstNode()
IStateBinaryTree.Node getLastNode()
IStateBinaryTree.Node prevNode(IStateBinaryTree.Node n)
n
- the reference node
IStateBinaryTree.Node nextNode(IStateBinaryTree.Node n)
n
- the reference node
IStateBinaryTree.Node nextNode(int value)
value
- the value whose next is to be searched
IStateBinaryTree.Node prevNode(int value)
value
- the value whose previous is to be searched
String toString()
toString
in class Object
DisposableIntIterator getIterator()
String toDotty()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |