public class SiteConstraints
extends java.lang.Object
Constructor and Description |
---|
SiteConstraints(java.util.Set<java.lang.String> allStates)
Standard constructor that creates an object with no constraints
|
Modifier and Type | Method and Description |
---|---|
void |
addConstraint(java.lang.String n,
java.util.Set<java.lang.String> c)
Adds a constraint
|
void |
addConstraint(java.lang.String n,
java.lang.String c)
Adds a constraint where a node is constrained to a single state
|
SiteConstraints |
clone() |
java.util.Set<java.lang.String> |
getConstraint(java.lang.String n)
Gets the constraints for a node
|
boolean |
meetsConstrains(Site s)
Tests whether a given site (that should include data for internal nodes)
meets the defined constraints
|
boolean |
nodeIsConstrained(java.lang.String n)
Tests whether a node has a constraint
|
public SiteConstraints(java.util.Set<java.lang.String> allStates)
allStates
- The set of all possible statespublic void addConstraint(java.lang.String n, java.lang.String c)
n
- The nodec
- The state it is constrained topublic void addConstraint(java.lang.String n, java.util.Set<java.lang.String> c)
n
- The node to add the constraint toc
- The states the node is constrained topublic java.util.Set<java.lang.String> getConstraint(java.lang.String n)
n
- The node to get constraints forpublic boolean meetsConstrains(Site s)
s
- The sitepublic boolean nodeIsConstrained(java.lang.String n)
n
- The nodepublic SiteConstraints clone()
clone
in class java.lang.Object