public class PQRTree<E> extends Object implements Iterable<E>
| Modifier and Type | Class and Description |
|---|---|
static class |
PQRTree.Color
Types of node colors.
|
class |
PQRTree.Leaf
A node that has a value
|
class |
PQRTree.Node
Represents a PQR Tree node
|
static class |
PQRTree.NodeType
Node types.
|
| Modifier and Type | Field and Description |
|---|---|
protected int |
currentConstraintSetId
Id of the constraint set for which we are currently working
|
protected boolean |
hasRNode
TRUE if the tree has an R-node (and is thus unsolveable)
|
protected Map<E,PQRTree.Leaf> |
leafMap
Serves to find out where an element is in the tree
|
protected PQRTree.Node |
root
Holds the root of the tree
|
| Constructor and Description |
|---|
PQRTree(Collection<E> elements)
Constructs a PQR tree with initial leaves
|
PQRTree(E... elements)
Constructs a PQR tree with initial leaves
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
addConstraint(Collection<E> elements)
Adds a constraint.
|
boolean |
addConstraint(E... elements)
Adds a constraint
|
boolean |
isSolveable()
Says whether the the tree has no R-node
|
PeekIterator<E> |
iterator()
Iterates over the leaves in the right order
|
static void |
main(String[] args)
Test method
|
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitforEach, spliteratorprotected Map<E,PQRTree.Leaf> leafMap
protected boolean hasRNode
protected PQRTree.Node root
protected int currentConstraintSetId
public PQRTree(Collection<E> elements)
public PQRTree(E... elements)
public boolean isSolveable()
public boolean addConstraint(E... elements)
public boolean addConstraint(Collection<E> elements)
public PeekIterator<E> iterator()
Copyright © 2018. All rights reserved.