mesquite.categ.lib
Class CategoricalAdjustable

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
All Implemented Interfaces:
AdjustableDistribution, CharacterDistribution, CharacterStatesHolder, Listable, Renamable, WithStringDetails
Direct Known Subclasses:
CategoricalHistory, DNACharacterAdjustable, ProteinAdjustable

public class CategoricalAdjustable
extends CategoricalDistribution
implements AdjustableDistribution

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


Field Summary
protected  int numNodes
           
 long[] 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
CategoricalAdjustable(Taxa taxa)
           
CategoricalAdjustable(Taxa taxa, int num)
           
 
Method Summary
 AdjustableDistribution adjustSize(Taxa taxa)
          This readjust procedure can be called to readjust the size of storage of states of a character for nodes.
 void deassignStates()
          set all states to missing (unassigned)
 int getNumNodes()
          get number of nodes available in this categorical character.
 int getNumTaxa()
          get number of taxa available in this categorical character.
 long getState(int N)
          get stateset at node N
 void setCharacterState(int N, CharacterState cs)
          sets state at node N to stateset passed
 void setState(int N, long d)
          sets state at node N to stateset passed
 void setStates(long[] sStates)
          Set states array to be one passed
 void setWatchPoint(int N)
          set watchpoint at node N.
 void tradeStatesBetweenTaxa(int it, int it2)
          Trade states of nodes it and it2
 
Methods inherited from class mesquite.categ.lib.CategoricalDistribution
adjustHistorySize, fullSet, getAdjustableClone, getMaxState, hasInapplicable, hasInapplicable, hasMissing, hasMissing, hasMultipleStatesInTaxon, hasMultipleStatesInTaxon, isBinary, isBinary, isBinaryCombinable, isBinaryNoMissing, isConstant, isConstant, makeAdjustable
 
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, 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.AdjustableDistribution
setParentCharacter, setParentData
 
Methods inherited from interface mesquite.lib.characters.CharacterStatesHolder
firstIsGreater, getCharacterDataClass, getCharacterState, getCharacterState, getDefaultModel, 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
 

Field Detail

states

public long[] states

numNodes

protected int numNodes
Constructor Detail

CategoricalAdjustable

public CategoricalAdjustable(Taxa taxa,
                             int num)

CategoricalAdjustable

public CategoricalAdjustable(Taxa taxa)
Method Detail

getNumTaxa

public int getNumTaxa()
get number of taxa available in this categorical character.

Specified by:
getNumTaxa in interface CharacterStatesHolder

getNumNodes

public int getNumNodes()
get number of nodes available in this categorical character.

Specified by:
getNumNodes in interface CharacterStatesHolder
Overrides:
getNumNodes in class CategoricalDistribution

deassignStates

public void deassignStates()
set all states to missing (unassigned)

Specified by:
deassignStates in interface AdjustableDistribution

setStates

public void setStates(long[] sStates)
Set states array to be one passed


getState

public long getState(int N)
get stateset at node N

Specified by:
getState in class CategoricalStates

setState

public void setState(int N,
                     long d)
sets state at node N to stateset passed


setCharacterState

public void setCharacterState(int N,
                              CharacterState cs)
sets state at node N to stateset passed

Specified by:
setCharacterState in interface AdjustableDistribution

setWatchPoint

public void setWatchPoint(int N)
set watchpoint at node N. Subsequently moniters to see if its value changed and gives notification. May not work well (changes may not be checked in all places.


tradeStatesBetweenTaxa

public void tradeStatesBetweenTaxa(int it,
                                   int it2)
Trade states of nodes it and it2

Specified by:
tradeStatesBetweenTaxa in interface AdjustableDistribution

adjustSize

public AdjustableDistribution adjustSize(Taxa taxa)
This readjust procedure can be called to readjust the size of storage of states of a character for nodes.

Specified by:
adjustSize in interface AdjustableDistribution