fr.ifremer.isisfish.simulator.sensitivity
Class FactorGroup

java.lang.Object
  extended by fr.ifremer.isisfish.simulator.sensitivity.Factor
      extended by fr.ifremer.isisfish.simulator.sensitivity.FactorGroup
All Implemented Interfaces:
Serializable, Cloneable

public class FactorGroup
extends Factor

Factor group. Used for group screening. A factor mixed can accept both discrete and continuous factors (used for convenience : factor tree root). A factor group without factors is untyped.

Since:
3.4.0.0 Last update : $Date: 2011-10-25 17:44:17 +0200 (Tue, 25 Oct 2011) $ By : $Author$
Version:
$Revision: 3487 $
Author:
chatellier
See Also:
Serialized Form

Nested Class Summary
protected static class FactorGroup.FactorComparator
           
 
Field Summary
protected  boolean continuous
          Factor group is typed discrete/continuous.
protected  List<Factor> factors
          Factors collection.
 
Fields inherited from class fr.ifremer.isisfish.simulator.sensitivity.Factor
cardinality, comment, domain, identifier, name, nominalValue, path, value
 
Constructor Summary
FactorGroup(String name)
          Init factor group.
FactorGroup(String name, boolean continuous)
          Init factor group.
 
Method Summary
 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.
 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()
           
 
Methods inherited from class fr.ifremer.isisfish.simulator.sensitivity.Factor
accept, clone, getCardinality, getComment, getName, getNominalValue, getPath, getValue, setCardinality, setComment, setDomain, setName, setNominalValue, setPath, setValue
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

factors

protected List<Factor> factors
Factors collection.


continuous

protected boolean continuous
Factor group is typed discrete/continuous. Continuous group can accept only continuous factors. Discrete group can accept both discrete and continuous factors.

Constructor Detail

FactorGroup

public FactorGroup(String name)
Init factor group.

Parameters:
name - group name

FactorGroup

public FactorGroup(String name,
                   boolean continuous)
Init factor group.

Parameters:
name - group name
continuous - continuous domain
Method Detail

addAllFactors

public void addAllFactors(List<Factor> allFactors)
Add all checked factors.

Parameters:
allFactors - factors to add

addFactor

public void addFactor(Factor factor)
Check factor type and add it into factor collection.

Parameters:
factor -

checkFactor

protected void checkFactor(Factor factor)
Check factor type with other factor collection types.

Parameters:
factor - factor to check
Throws:
IllegalArgumentException - if factor doesn't match other factor type

remove

public void remove(Factor factor)
Remove single factor.

Parameters:
factor - factor to remove

removeAll

public void removeAll(Collection<Factor> allFactors)
Remove factors collection.

Parameters:
allFactors - factors to remove

getFactors

public List<Factor> getFactors()
Get groups factors.

Returns:
unmodifiable factors list

clearFactors

public void clearFactors()
Clear all factor group sub factors.


get

public Factor get(int index)
Convenient method to access specific factor.

Parameters:
index - index
Returns:
factor at index

size

public int size()
Get factor list size.

Returns:
factor list size

indexOf

public int indexOf(Object o)
Returns the index of the first occurrence of the specified element in this group.

Parameters:
o - element to search for
Returns:
the index of the first occurrence of the specified element in this group, or -1 if this list does not contain the element

isDiscrete

public boolean isDiscrete()
Return true if factor group is discrete.

Returns:
true if factor group is discrete

isContinuous

public boolean isContinuous()
Return true if factor group is continuous.

Returns:
true if factor group is continuous

getDomain

public Domain getDomain()
Return factor group domain depending of factor group type (discrete/continuous).

Overrides:
getDomain in class Factor
Returns:
factor group domain

accept

public void accept(FactorGroupVisitor visitor)
Accept a new visitor.

Parameters:
visitor -

toString

public String toString()
Overrides:
toString in class Factor

setValueForIdentifier

public void setValueForIdentifier(Object valueIdentifier)
Set value for label.

Overrides:
setValueForIdentifier in class Factor
Parameters:
valueIdentifier - new value identifier to get

getDisplayedValue

public Object getDisplayedValue()
Get the factor value for displaying (for example in R).

Overrides:
getDisplayedValue in class Factor
Returns:
the value


Copyright © 1999-2012 CodeLutin. All Rights Reserved.