| Constructor and Description |
|---|
LogicGroup(Logic[] members)
Creates a new Logic group
|
| Modifier and Type | Method and Description |
|---|---|
Logic |
all()
Creates a Logic instance over the group, defined by
Logic.all(Logic...). |
Logic |
any()
Creates a Logic instance over the group, defined by
Logic.any(Logic...). |
Logic |
count(int target)
Creates a Logic instance over the group, defined by
Logic.count(int, Logic...). |
LogicGroup |
merge(LogicGroup other)
Merges this LogicGroup with another one and returns a new LogicGroup
containing the members from both this and the other group.
|
Logic |
none()
Creates a Logic instance over the group, defined by
Logic.none(Logic...). |
int |
size() |
Logic |
strict(LogicGroup domain)
Strict group evaluation on a restricted domain.
|
Logic[] |
toArray()
Provides an array containing all group members
|
public LogicGroup(Logic[] members)
members - the group membersjava.lang.NullPointerException - if the members array is null or contains any
null elementsjava.lang.IllegalArgumentException - if the members array is emptypublic Logic[] toArray()
public Logic any()
Logic.any(Logic...).public Logic all()
Logic.all(Logic...).public Logic none()
Logic.none(Logic...).public Logic count(int target)
Logic.count(int, Logic...).target - the exact number of group members to evaluate to true
for the created Logic instance to evaluate to truejava.lang.IllegalArgumentException - if the target value is negative or larger than the group sizeLogic.count(int, Logic...)public int size()
public LogicGroup merge(LogicGroup other)
other - the group to merge this group withpublic Logic strict(LogicGroup domain)
Logic instance evaluates to true iff all elements of this
group evaluate to true (i.e. this.all() == true) and the
given domain has n elements that evaluate to true, where
n == this.size(). There are no checks done, therefore one must
ensure that provided domain is a superset of this group.
This allows to check if from a given domain exactly the elements of this
group evaluate to true.domain - the domain to restrict over.java.lang.NullPointerException - the domain is nullCopyright © 2018. All Rights Reserved.