mesquite.categ.lib
Class CategoricalDistribution

java.lang.Object
  extended by mesquite.lib.characters.CharacterStates
      extended by mesquite.categ.lib.CategoricalStates
          extended by mesquite.categ.lib.CategoricalDistribution
All Implemented Interfaces:
CharacterDistribution, CharacterStatesHolder, Listable, Renamable, WithStringDetails
Direct Known Subclasses:
CategoricalAdjustable, CategoricalEmbedded

public abstract class CategoricalDistribution
extends CategoricalStates
implements CharacterDistribution

A class for an array of categorical character states for one character, at each of the taxa or nodes


Field Summary
 
Fields inherited from class mesquite.categ.lib.CategoricalStates
allStates, enforcedMaxState, extraFrequencies, extraFrequencyColors, extraFrequencyNames, frequencies, maxFound, maxState, minFound, minState
 
Fields inherited from class mesquite.lib.characters.CharacterStates
characterNumber, data, totalCreated
 
Constructor Summary
CategoricalDistribution(Taxa taxa)
           
 
Method Summary
 CharacterHistory adjustHistorySize(Tree tree, CharacterHistory charStates)
          This readjust procedure can be called to readjust the size of storage of states of a character for nodes.
 long fullSet()
          Returns full set of allowed states
 AdjustableDistribution getAdjustableClone()
          returns a CharacterDistribution that is adjustable and has the same states
 int getMaxState()
          Returns largest state value
 int getNumNodes()
          returns number of nodes for which CharacterStates is defined (either terminal taxa, if CharacterDistribution, or all nodes in tree, if CharacterHistory)
 boolean hasInapplicable()
          Returns whether or not the character has inapplicable codings (gaps)
 boolean hasInapplicable(Tree tree, int node)
          Returns whether or not the character has inapplicable codings (gaps) in the taxa of the tree
 boolean hasMissing()
          Returns whether or not the character has missing (unassigned) data
 boolean hasMissing(Tree tree, int node)
          Returns whether or not the character has missing (unassigned) data in the taxa of the tree
 boolean hasMultipleStatesInTaxon()
          Returns whether or not the character has polymorphic or multstate uncertain data
 boolean hasMultipleStatesInTaxon(Tree tree, int node)
          Returns whether or not the character has polymorphic or multstate uncertain data in the taxa of the tree
static boolean isBinary(CharacterDistribution dist, Tree tree)
          Returns whether or not the character is all binary in the taxa of the tree
 boolean isBinary(int node)
          Returns whether or not the character is binary
 boolean isBinaryCombinable(int node)
          Returns whether or not the character is binary and with an actual state
static boolean isBinaryNoMissing(CharacterDistribution dist, Tree tree)
          Returns whether or not the character is all binary and no missing in the taxa of the tree
 boolean isConstant()
          Returns whether or not the character is constant (all states are the same)
 boolean isConstant(Tree tree, int node)
          Returns whether or not the character is constant (all states are the same) in the taxa of the tree
 CategoricalAdjustable makeAdjustable(Taxa taxa)
           
 
Methods inherited from class mesquite.categ.lib.CategoricalStates
copyExtraFrequencies, copyFrequencies, disposeExtraFrequencies, disposeFrequencies, extraFrequenciesExist, firstIsGreater, frequenciesExist, getAllStates, getAllStates, getCharacterDataClass, getCharacterState, getCharacterState, getDataTypeName, getDefaultModel, getExtraFrequencies, getExtraFrequency, getExtraFrequencyColors, getExtraFrequencyNames, getExtraNumFreqCategories, getFrequencies, getFrequency, getNumFreqCategories, getSetFromFrequencies, getState, getStateClass, isInapplicable, isUnassigned, isUncertain, logStates, setExtraFrequencies, setExtraFrequency, setExtraFrequencyColors, setExtraFrequencyNames, setFrequencies, setFrequency, setNumExtraFreqCategories, setNumFreqCategories, statesEqual, toString, toString
 
Methods inherited from class mesquite.lib.characters.CharacterStates
checkIllegalNode, getName, getParentCharacter, getParentData, getTaxa, makeCharacterState, setName, setParentCharacter, setParentData, setTaxa, toExternal, toInternal, toStringWithDetails
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface mesquite.lib.characters.CharacterStatesHolder
firstIsGreater, getCharacterDataClass, getCharacterState, getCharacterState, getDefaultModel, getNumTaxa, getParentCharacter, getParentData, getStateClass, getTaxa, isInapplicable, isUnassigned, isUncertain, logStates, statesEqual, toString, toStringWithDetails
 
Methods inherited from interface mesquite.lib.Listable
getName
 
Methods inherited from interface mesquite.lib.Renamable
setName
 

Constructor Detail

CategoricalDistribution

public CategoricalDistribution(Taxa taxa)
Method Detail

getNumNodes

public int getNumNodes()
Description copied from interface: CharacterStatesHolder
returns number of nodes for which CharacterStates is defined (either terminal taxa, if CharacterDistribution, or all nodes in tree, if CharacterHistory)

Specified by:
getNumNodes in interface CharacterStatesHolder

fullSet

public long fullSet()
Returns full set of allowed states


getMaxState

public int getMaxState()
Returns largest state value


hasMultipleStatesInTaxon

public boolean hasMultipleStatesInTaxon()
Returns whether or not the character has polymorphic or multstate uncertain data


hasMissing

public boolean hasMissing()
Returns whether or not the character has missing (unassigned) data

Specified by:
hasMissing in interface CharacterDistribution

hasInapplicable

public boolean hasInapplicable()
Returns whether or not the character has inapplicable codings (gaps)

Specified by:
hasInapplicable in interface CharacterDistribution

hasMultipleStatesInTaxon

public boolean hasMultipleStatesInTaxon(Tree tree,
                                        int node)
Returns whether or not the character has polymorphic or multstate uncertain data in the taxa of the tree


hasMissing

public boolean hasMissing(Tree tree,
                          int node)
Returns whether or not the character has missing (unassigned) data in the taxa of the tree

Specified by:
hasMissing in interface CharacterDistribution

hasInapplicable

public boolean hasInapplicable(Tree tree,
                               int node)
Returns whether or not the character has inapplicable codings (gaps) in the taxa of the tree

Specified by:
hasInapplicable in interface CharacterDistribution

isBinaryNoMissing

public static boolean isBinaryNoMissing(CharacterDistribution dist,
                                        Tree tree)
Returns whether or not the character is all binary and no missing in the taxa of the tree


isBinary

public static boolean isBinary(CharacterDistribution dist,
                               Tree tree)
Returns whether or not the character is all binary in the taxa of the tree


isBinary

public boolean isBinary(int node)
Returns whether or not the character is binary


isBinaryCombinable

public boolean isBinaryCombinable(int node)
Returns whether or not the character is binary and with an actual state


isConstant

public boolean isConstant()
Returns whether or not the character is constant (all states are the same)

Specified by:
isConstant in interface CharacterDistribution

isConstant

public boolean isConstant(Tree tree,
                          int node)
Returns whether or not the character is constant (all states are the same) in the taxa of the tree

Specified by:
isConstant in interface CharacterDistribution

getAdjustableClone

public AdjustableDistribution getAdjustableClone()
returns a CharacterDistribution that is adjustable and has the same states

Specified by:
getAdjustableClone in interface CharacterDistribution

makeAdjustable

public CategoricalAdjustable makeAdjustable(Taxa taxa)

adjustHistorySize

public CharacterHistory adjustHistorySize(Tree tree,
                                          CharacterHistory charStates)
This readjust procedure can be called to readjust the size of storage of states of a character for nodes.

Specified by:
adjustHistorySize in interface CharacterDistribution