T - Field typepublic class FieldRule<T> extends Object
FieldGroups that should have a specific sum| Constructor and Description |
|---|
FieldRule(FieldRule<T> copyFrom)
Create a copy of an existing rule.
|
FieldRule(T cause,
Collection<T> rule,
int result)
Create a rule from a list of fields and a result (create a new FieldGroup for it)
|
| Modifier and Type | Method and Description |
|---|---|
T |
getCause() |
Collection<FieldGroup<T>> |
getFieldGroups() |
int |
getFieldsCountInGroups() |
int |
getResult() |
FieldGroup<T> |
getSmallestFieldGroup() |
boolean |
isEmpty() |
double |
nCr() |
SimplifyResult |
simplify(GroupValues<T> knownValues) |
String |
toString() |
public FieldRule(FieldRule<T> copyFrom)
copyFrom - Rule to copypublic FieldRule(T cause, Collection<T> rule, int result)
cause - The reason for why this rule is added (optional, may be null)rule - Fields that this rule applies toresult - The value that should be forced for the fieldspublic T getCause()
public Collection<FieldGroup<T>> getFieldGroups()
public int getFieldsCountInGroups()
public int getResult()
public FieldGroup<T> getSmallestFieldGroup()
public boolean isEmpty()
public double nCr()
public SimplifyResult simplify(GroupValues<T> knownValues)
Copyright © 2014. All rights reserved.