Likelihood
Class Likelihood.NodeLikelihood

java.lang.Object
  extended by Likelihood.Likelihood.NodeLikelihood
All Implemented Interfaces:
java.io.Serializable
Enclosing class:
Likelihood

public static class Likelihood.NodeLikelihood
extends java.lang.Object
implements java.io.Serializable

Stores the results of a likelihood claculation for a single node in a tree. That is the partial likelihoods for each possible state. This is one of only two classes where backwards compitability with 1.1 is not possible. The previous constructor only contained information on the states and not what position they mapped too. The new, more efficient data structures need to knoiw the mapping so there's no way the old constructor is usable.

Version:
1.2
See Also:
Serialized Form

Constructor Summary
Likelihood.NodeLikelihood(ArrayMap<java.lang.String,java.lang.Integer> states, java.util.Set<java.lang.String> allowedStates)
          Default constructor
 
Method Summary
 Likelihood.NodeLikelihood clone()
           
 double getLikelihood(int i)
          Returns the partial likelihood for the state at position i.
 double getLikelihood(java.lang.String state)
          Returns the partial likelihood for a given state
 double[] getLikelihoods()
          Returns the partial likelihood for each state as an array.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Likelihood.NodeLikelihood

public Likelihood.NodeLikelihood(ArrayMap<java.lang.String,java.lang.Integer> states,
                                 java.util.Set<java.lang.String> allowedStates)
Default constructor

Parameters:
states - Map from a state to it's position in the array
allowedStates - The allowed states at this state
Method Detail

clone

public Likelihood.NodeLikelihood clone()
Overrides:
clone in class java.lang.Object

getLikelihood

public double getLikelihood(java.lang.String state)
                     throws Likelihood.LikelihoodException
Returns the partial likelihood for a given state

Parameters:
state - The state to return the partial likelihood for
Returns:
The partial likelihood for the given state
Throws:
Likelihood.LikelihoodException - Thrown if no likelihood has been calculated for the given state

getLikelihood

public double getLikelihood(int i)
Returns the partial likelihood for the state at position i. Mainly intended to be used internally

Parameters:
i - The position
Returns:
The likelihood for the state associated with that position (as defined by the map passed to the constructor)

getLikelihoods

public double[] getLikelihoods()
Returns the partial likelihood for each state as an array. Mainly intended to be used internally

Returns:
The likelihood for each state. Position is associated with state based on the map passed to the constructor.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object