public class FactorGroup extends Factor
Modifier and Type | Class and Description |
---|---|
protected static class |
FactorGroup.FactorComparator |
Modifier and Type | Field and Description |
---|---|
protected boolean |
continuous
Factor group is typed discrete/continuous.
|
protected List<Factor> |
factors
Factors collection.
|
cardinality, comment, domain, equationVariableName, identifier, name, nominalValue, path, value
Constructor and Description |
---|
FactorGroup(String name)
Init factor group.
|
FactorGroup(String name,
boolean continuous)
Init factor group.
|
Modifier and Type | Method and Description |
---|---|
void |
accept(FactorGroupVisitor visitor)
Accept a new visitor.
|
void |
addAllFactors(List<Factor> allFactors)
Add all checked factors.
|
void |
addFactor(Factor factor)
Check factor type and add it into factor collection.
|
protected void |
checkFactor(Factor factor)
Check factor type with other factor collection types.
|
void |
clearFactors()
Clear all factor group sub factors.
|
Object |
clone() |
Factor |
get(int index)
Convenient method to access specific factor.
|
Object |
getDisplayedValue()
Get the factor value for displaying (for example in R).
|
Domain |
getDomain()
Return factor group domain depending of factor group type (discrete/continuous).
|
List<Factor> |
getFactors()
Get groups factors.
|
int |
indexOf(Object o)
Returns the index of the first occurrence of the specified element in this
group.
|
boolean |
isContinuous()
Return
true if factor group is continuous. |
boolean |
isDiscrete()
Return
true if factor group is discrete. |
void |
remove(Factor factor)
Remove single factor.
|
void |
removeAll(Collection<Factor> allFactors)
Remove factors collection.
|
void |
setValueForIdentifier(Object valueIdentifier)
Set value for label.
|
int |
size()
Get factor list size.
|
String |
toString() |
accept, getCardinality, getComment, getEquationVariableName, getName, getNominalValue, getPath, getValue, setCardinality, setComment, setDomain, setEquationVariableName, setName, setNominalValue, setPath, setValue
protected boolean continuous
public FactorGroup(String name)
name
- group namepublic FactorGroup(String name, boolean continuous)
name
- group namecontinuous
- continuous domainpublic void addAllFactors(List<Factor> allFactors)
allFactors
- factors to addpublic void addFactor(Factor factor)
factor
- protected void checkFactor(Factor factor)
factor
- factor to checkIllegalArgumentException
- if factor doesn't match other factor typepublic void remove(Factor factor)
factor
- factor to removepublic void removeAll(Collection<Factor> allFactors)
allFactors
- factors to removepublic void clearFactors()
public Factor get(int index)
index
- indexpublic int size()
public int indexOf(Object o)
o
- element to search forpublic boolean isDiscrete()
true
if factor group is discrete.true
if factor group is discretepublic boolean isContinuous()
true
if factor group is continuous.true
if factor group is continuouspublic Domain getDomain()
public void accept(FactorGroupVisitor visitor)
visitor
- public void setValueForIdentifier(Object valueIdentifier)
setValueForIdentifier
in class Factor
valueIdentifier
- new value identifier to getpublic Object getDisplayedValue()
getDisplayedValue
in class Factor
Copyright © 1999–2020 CodeLutin. All rights reserved.