public final class VtreeLeaf extends Vtree
VtreeLeaf, i.e., a (vtree) leaf,
is a tree that contains a single variable.
p>
To date, there may be two equals VtreeLeaf that are not equal by ==.
One might therefore want to be careful
and avoid an explosion of the number of equivalent instances of VtreeLeaf
(cf. the implementation of VtreeNode for instance).| Modifier and Type | Method and Description |
|---|---|
boolean |
addVariables(java.util.Set<Variable> s)
Adds the variables in this vtree to the specified set.
|
boolean |
contains(Vtree vt)
Indicates whether this vtree contains the specified vtree.
|
static VtreeLeaf |
create(Variable var)
Returns the vtree leaf associated with the specified variable.
|
boolean |
equivalent(java.lang.Object o)
Indicates whether the specified object
is equivalent to this object.
|
boolean |
findPathTo(Vtree vt,
java.util.List<VtreeNode> path)
Stores in the specified list the ``path''
from this vtree to the specified vtree (excluded).
|
protected java.util.Map<java.lang.Object,VtreeLeaf> |
getBuffer()
Returns the buffer that is used to decide the canonical objects.
|
int |
getDepth()
Returns the depth of this vtree.
|
Variable |
getVariable()
Returns the (single) variable associated with this vtree.
|
java.util.Set<Variable> |
getVariables()
Returns the collection of variables
that decorate the leaves of this vtree.
|
int |
hashCode() |
boolean |
isLeaf()
Indicates whether this vtree is a leaf.
|
java.lang.String |
toString() |
destroy, equals, getCanonical, print, unwatch, unwatchAll, verifyValidity, watchpublic static VtreeLeaf create(Variable var)
var - the variable whose vtree is returned.public int hashCode()
hashCode in class CanonicalWatchedpublic boolean equivalent(java.lang.Object o)
CanonicalWatchedequivalent in class CanonicalWatchedo - the object compared to this object.public java.lang.String toString()
toString in class java.lang.Objectpublic Variable getVariable()
public java.util.Set<Variable> getVariables()
VtreegetVariables in class Vtreepublic boolean isLeaf()
Vtreepublic boolean addVariables(java.util.Set<Variable> s)
VtreeaddVariables in class Vtrees - the set where the variables in this vtree should be inserted.protected java.util.Map<java.lang.Object,VtreeLeaf> getBuffer()
CanonicalWatchedgetBuffer in class CanonicalWatchedpublic int getDepth()
Vtreepublic boolean contains(Vtree vt)
Vtreepublic boolean findPathTo(Vtree vt, java.util.List<VtreeNode> path)
VtreefindPathTo in class Vtreevt - the vtree to which a path is requested.path - the list where the path is recorded.