Class FactorGroup

java.lang.Object
org.jdesktop.beans.AbstractBean
fr.ifremer.isisfish.simulator.sensitivity.Factor
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$ By : $Author$
Version:
$Revision$
Author:
chatellier
See Also:
  • Field Details

    • 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 Details

    • 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 Details

    • 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
    • clone

      public Object clone()
      Overrides:
      clone in class Factor