mesquite.categ.lib
Class DNACharacterHistory

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

public class DNACharacterHistory
extends CategoricalHistory


Field Summary
 
Fields inherited from class mesquite.categ.lib.CategoricalAdjustable
numNodes, states
 
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
DNACharacterHistory(Taxa taxa)
           
DNACharacterHistory(Taxa taxa, int num)
           
 
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.
 CharacterHistory clone(CharacterHistory s)
          clone this; if passed s is not null, place the clone there (so as to avoid creating new object)
 long fullSet()
          Returns full set of allowed states
 long getAllStates()
          returns the union of all state sets
 java.lang.Class getCharacterDataClass()
          returns the corresponding CharacterData subclass
 CharacterState getCharacterState()
          returns blank CharacterState object
 CharacterState getCharacterState(CharacterState cs, int N)
          returns CharacterState at node N
 MesquiteColorTable getColorTable(MesquiteColorTable colorTable)
           
 java.lang.String getDataTypeName()
          returns the name of the type of data stored
 java.awt.Color getDefaultColor(int maxState, int istate)
          Places into ColorDistribution the colors at the node, and returns the number of colors.
 int getLegendStates(java.awt.Color[] cs, java.lang.String[] stateNames, java.awt.Point[] tableMappings, MesquiteColorTable stateColors)
          Get the information about states occurring in this object for a legend.
 java.lang.Class getStateClass()
          Indicates the type of character stored
 CategoricalAdjustable makeAdjustable(Taxa taxa)
           
 CharacterHistory makeHistory(Tree tree)
           
 void prepareColors(Tree tree, int drawnRoot)
          Must be called before colors for states are used (e.g., before a tree is shaded).
 java.lang.String toString()
          returns string describing states at nodes.
 java.lang.String toString(int node, java.lang.String lineEnding)
          returns string describing character states at node
 
Methods inherited from class mesquite.categ.lib.CategoricalHistory
addInternodeEvent, adjustSize, deassignStates, getColorsAtNode, getColorSequenceAtNode, getColorsOfState, getInternodeEvent, getInternodeHistoryVector, getNumberOfEvents, getObservedStates, getStatesAtTips, polymorphToUncertainties, prepareInternodeHistories, setObservedStates
 
Methods inherited from class mesquite.categ.lib.CategoricalAdjustable
adjustSize, getNumNodes, getNumTaxa, getState, setCharacterState, setState, setStates, setWatchPoint, tradeStatesBetweenTaxa
 
Methods inherited from class mesquite.categ.lib.CategoricalDistribution
getAdjustableClone, getMaxState, hasInapplicable, hasInapplicable, hasMissing, hasMissing, hasMultipleStatesInTaxon, hasMultipleStatesInTaxon, isBinary, isBinary, isBinaryCombinable, isBinaryNoMissing, isConstant, isConstant
 
Methods inherited from class mesquite.categ.lib.CategoricalStates
copyExtraFrequencies, copyFrequencies, disposeExtraFrequencies, disposeFrequencies, extraFrequenciesExist, firstIsGreater, frequenciesExist, getAllStates, getDefaultModel, getExtraFrequencies, getExtraFrequency, getExtraFrequencyColors, getExtraFrequencyNames, getExtraNumFreqCategories, getFrequencies, getFrequency, getNumFreqCategories, getSetFromFrequencies, isInapplicable, isUnassigned, isUncertain, logStates, setExtraFrequencies, setExtraFrequency, setExtraFrequencyColors, setExtraFrequencyNames, setFrequencies, setFrequency, setNumExtraFreqCategories, setNumFreqCategories, statesEqual
 
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.AdjustableDistribution
adjustSize, setCharacterState, setParentCharacter, setParentData, tradeStatesBetweenTaxa
 
Methods inherited from interface mesquite.lib.characters.CharacterStatesHolder
firstIsGreater, getDefaultModel, getNumNodes, getNumTaxa, getParentCharacter, getParentData, getTaxa, isInapplicable, isUnassigned, isUncertain, logStates, statesEqual, toStringWithDetails
 
Methods inherited from interface mesquite.lib.Listable
getName
 
Methods inherited from interface mesquite.lib.Renamable
setName
 

Constructor Detail

DNACharacterHistory

public DNACharacterHistory(Taxa taxa)

DNACharacterHistory

public DNACharacterHistory(Taxa taxa,
                           int num)
Method Detail

getCharacterState

public CharacterState getCharacterState()
returns blank CharacterState object

Specified by:
getCharacterState in interface CharacterStatesHolder
Overrides:
getCharacterState in class CategoricalStates

getStateClass

public java.lang.Class getStateClass()
Indicates the type of character stored

Specified by:
getStateClass in interface CharacterStatesHolder
Overrides:
getStateClass in class CategoricalStates

getCharacterDataClass

public java.lang.Class getCharacterDataClass()
returns the corresponding CharacterData subclass

Specified by:
getCharacterDataClass in interface CharacterStatesHolder
Overrides:
getCharacterDataClass in class CategoricalStates

fullSet

public long fullSet()
Returns full set of allowed states

Overrides:
fullSet in class CategoricalDistribution

getDataTypeName

public java.lang.String getDataTypeName()
returns the name of the type of data stored

Overrides:
getDataTypeName in class CategoricalStates

getCharacterState

public CharacterState getCharacterState(CharacterState cs,
                                        int N)
returns CharacterState at node N

Specified by:
getCharacterState in interface CharacterStatesHolder
Overrides:
getCharacterState in class CategoricalStates

getAllStates

public long getAllStates()
returns the union of all state sets

Overrides:
getAllStates in class CategoricalStates

clone

public CharacterHistory clone(CharacterHistory s)
clone this; if passed s is not null, place the clone there (so as to avoid creating new object)

Specified by:
clone in interface CharacterHistory
Overrides:
clone in class CategoricalHistory

getDefaultColor

public java.awt.Color getDefaultColor(int maxState,
                                      int istate)
Description copied from class: CategoricalHistory
Places into ColorDistribution the colors at the node, and returns the number of colors. Uses passed stateColors as color key. If null is passed, uses color system of parent data (using maxState of this StsOfCharcter) or, if there is not parent data object, the default colors. * public int getColorsAtNode(int node, ColorDistribution colors,MesquiteColorTable stateColors, boolean showWeights) { return getColorsAtNode(node, colors, stateColors, showWeights, MesquiteColorTable.DEFAULT); }

Overrides:
getDefaultColor in class CategoricalHistory

prepareColors

public void prepareColors(Tree tree,
                          int drawnRoot)
Must be called before colors for states are used (e.g., before a tree is shaded). Goes through all nodes to find states present, to set minima and maxima and record all states present. This allows the color range to be known before colors for particular states are requested by a tree shade, for example.

Specified by:
prepareColors in interface CharacterHistory
Overrides:
prepareColors in class CategoricalHistory

getColorTable

public MesquiteColorTable getColorTable(MesquiteColorTable colorTable)
Specified by:
getColorTable in interface CharacterHistory
Overrides:
getColorTable in class CategoricalHistory

getLegendStates

public int getLegendStates(java.awt.Color[] cs,
                           java.lang.String[] stateNames,
                           java.awt.Point[] tableMappings,
                           MesquiteColorTable stateColors)
Description copied from class: CategoricalHistory
Get the information about states occurring in this object for a legend. Colors and state names of states are place in the passed array. The colors for states are taken from the passed MesquiteColorTable.

Specified by:
getLegendStates in interface CharacterHistory
Overrides:
getLegendStates in class CategoricalHistory

toString

public java.lang.String toString(int node,
                                 java.lang.String lineEnding)
returns string describing character states at node

Specified by:
toString in interface CharacterStatesHolder
Overrides:
toString in class CategoricalHistory

toString

public java.lang.String toString()
returns string describing states at nodes.

Overrides:
toString in class CategoricalStates

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
Overrides:
adjustHistorySize in class CategoricalDistribution

makeHistory

public CharacterHistory makeHistory(Tree tree)
Overrides:
makeHistory in class CategoricalHistory

makeAdjustable

public CategoricalAdjustable makeAdjustable(Taxa taxa)
Overrides:
makeAdjustable in class CategoricalDistribution