Class AbstractOrderNDistribution

    • Field Detail

      • weightForwarder

        protected transient ChangeForwarder weightForwarder
        The listener that will forward events from the underlying distributions to listeners for this distribution.
    • Method Detail

      • getChangeSupport

        protected ChangeSupport getChangeSupport​(ChangeType ct)
        Description copied from class: AbstractChangeable
        Called to retrieve the ChangeSupport for this object.

        Your implementation of this method should have the following structure:

         ChangeSupport cs = super.getChangeSupport(ct);
        
         if(someForwarder == null && ct.isMatching(SomeInterface.SomeChangeType)) {
           someForwarder = new ChangeForwarder(...
        
           this.stateVariable.addChangeListener(someForwarder, VariableInterface.AChange);
         }
        
         return cs;
         
        It is usual for the forwarding listeners (someForwarder in this example) to be transient and lazily instantiated. Be sure to register & unregister the forwarder in the code that does the ChangeEvent handling in setter methods.
        Overrides:
        getChangeSupport in class AbstractDistribution
      • getConditioningAlphabet

        public Alphabet getConditioningAlphabet()
        Get the conditioning alphabet of this distribution. If the `overall' alphabet is a cross-product of two alphabets, this will be the first of those alphabets. If it is a cross-product of more than two alphabets, the conditioning alphabet is the cross-product of all but the last alphabet.
        Specified by:
        getConditioningAlphabet in interface OrderNDistribution
        Returns:
        the conditioning Alphabet
      • getConditionedAlphabet

        public Alphabet getConditionedAlphabet()
        Get the conditioned alphabet. This is the last alphabet in the distribution's overall cross-product. It will be the alphabet of all the sub-distributions contained within this OrderNDistribution.
        Specified by:
        getConditionedAlphabet in interface OrderNDistribution
        Returns:
        the conditioned Alphabet
      • getAlphabet

        public Alphabet getAlphabet()
        Description copied from interface: Distribution
        The alphabet from which this spectrum emits symbols.
        Specified by:
        getAlphabet in interface Distribution
        Returns:
        the Alphabet associated with this spectrum
      • setNullModelImpl

        public void setNullModelImpl​(Distribution nullModel)
        Description copied from class: AbstractDistribution
        Implement this to set the null model.

        You should not inform any change listeners in this method. All of that work has been done for you.

        Specified by:
        setNullModelImpl in class AbstractDistribution
        Parameters:
        nullModel - the new null model Distribution
      • getNullModel

        public Distribution getNullModel()
        Description copied from interface: Distribution
        Retrieve the null model Distribution that this Distribution recognizes.
        Specified by:
        getNullModel in interface Distribution
        Returns:
        the apropriate null model