public class ACQ_Network extends java.lang.Object implements java.lang.Iterable<ACQ_IConstraint>
Modifier and Type | Field and Description |
---|---|
protected ACQ_ConstraintSet |
constraints
Set of constraints of this network
|
protected ACQ_Scope |
variables
Variables of this network
|
Constructor and Description |
---|
ACQ_Network()
Empty constructor
|
ACQ_Network(ACQ_ConstraintSet constraints)
Constructor from a specified set of constraints
|
ACQ_Network(ACQ_Network other_network,
ACQ_Scope scope)
Constructor from an other network and a specified scope
It takes the constraints from the other network and the
scope from the specified scope
|
ACQ_Network(ACQ_Scope variables)
Constructor from a specified scope (variables)
|
ACQ_Network(ACQ_Scope variables,
ACQ_ConstraintSet constraints)
Constructor from a specified scope and set of constraints
|
ACQ_Network(ACQ_Scope variables,
ACQ_ConstraintSet constraints,
boolean add_variables)
Main constructor of networks
Build a network from the specified scope and the specified set of constraints
|
Modifier and Type | Method and Description |
---|---|
void |
add(ACQ_IConstraint cst,
boolean force)
Add a specified constraint to the set of this network
If force is set to false, the specified constraint will only be added
if all the variables of the specified constraint are contained in the variable set of this network
Else it will add the constraint and the missing variables
|
(package private) boolean |
check(ACQ_Query query)
Checks if the query violates this network of constraints
|
(package private) boolean |
checkNotAllNeg(ACQ_Query query)
checkNotAllNeg
|
ACQ_ConstraintSet |
getConstraints()
Returns the set of constraints of this network
|
java.util.Iterator<ACQ_IConstraint> |
iterator()
Returns an iterator of the set of constraints of this network
|
void |
printVariables()
Display all the details of the variables of this network
|
int |
size()
Returns the size of the set of constraints
|
java.lang.String |
toString() |
protected ACQ_Scope variables
protected ACQ_ConstraintSet constraints
public ACQ_Network()
public ACQ_Network(ACQ_Scope variables)
variables
- Scope that contains variablespublic ACQ_Network(ACQ_ConstraintSet constraints)
constraints
- Set of constraintspublic ACQ_Network(ACQ_Scope variables, ACQ_ConstraintSet constraints)
variables
- Scopeconstraints
- Set of constraintspublic ACQ_Network(ACQ_Network other_network, ACQ_Scope scope)
other_network
- Network to take constraints fromscope
- Scopepublic ACQ_Network(ACQ_Scope variables, ACQ_ConstraintSet constraints, boolean add_variables)
variables
- Scopeconstraints
- Set of constraintsadd_variables
- if false constraints are only added when all variables are already contained in variable set, else it will add the constraint and the missing variablespublic java.util.Iterator<ACQ_IConstraint> iterator()
iterator
in interface java.lang.Iterable<ACQ_IConstraint>
public int size()
public ACQ_ConstraintSet getConstraints()
public final void add(ACQ_IConstraint cst, boolean force)
cst
- Constraint to addforce
- Determine the way of addingpublic void printVariables()
boolean check(ACQ_Query query)
query
- Exampleboolean checkNotAllNeg(ACQ_Query query)
query
- public java.lang.String toString()
toString
in class java.lang.Object