mesquite.cont.lib
Class ContinuousAdjustable

java.lang.Object
  extended by mesquite.lib.characters.CharacterStates
      extended by mesquite.cont.lib.ContinuousStates
          extended by mesquite.cont.lib.ContinuousDistribution
              extended by mesquite.cont.lib.ContinuousAdjustable
All Implemented Interfaces:
ItemContainer, AdjustableDistribution, CharacterDistribution, CharacterStatesHolder, Listable, Renamable, WithStringDetails
Direct Known Subclasses:
ContinuousHistory, GeographicAdjustable

public class ContinuousAdjustable
extends ContinuousDistribution
implements AdjustableDistribution

Contains an array of continuous character states for one character, at each of the taxa or nodes


Field Summary
protected  DoubleArray firstItem
           
protected  java.util.Vector items
           
protected  int numNodes
           
 
Fields inherited from class mesquite.lib.characters.CharacterStates
characterNumber, data, totalCreated
 
Constructor Summary
ContinuousAdjustable(Taxa taxa, int numNodes)
           
 
Method Summary
 DoubleArray addItem(NameReference nr)
           
 DoubleArray addItem(java.lang.String name)
           
 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)
 DoubleArray establishItem(NameReference nr)
          Make an item with the passed name.
 DoubleArray establishItem(java.lang.String name)
           
 DoubleArray getItem(int index)
           
 java.lang.String getItemName(int index)
           
 int getItemNumber(NameReference nr)
           
 NameReference getItemReference(int index)
           
 NameReference getItemReference(java.lang.String name)
           
 int getNumItems()
           
 int getNumNodes()
          returns number of nodes for which CharacterStates is defined (either terminal taxa, if CharacterDistribution, or all nodes in tree, if CharacterHistory)
 int getNumTaxa()
          This is the same as getNumNodes.
 double getState(int N)
           
 double getState(int N, int item)
           
 void removeItem(int item)
          Removes item.
 void setCharacterState(int N, CharacterState cs)
          sets CharacterState at node/taxon it
 void setItemReference(int index, NameReference nr)
          Sets the name reference for the item number "index".
 void setItems(ContinuousAdjustable s)
           
 void setItems(java.lang.String[] names)
           
 void setItemsAs(ItemContainer iCont)
           
 void setState(int N, double d)
           
 void setState(int N, int item, double d)
           
 void tradeStatesBetweenTaxa(int it, int it2)
          Trade states of nodes it and it2
 
Methods inherited from class mesquite.cont.lib.ContinuousDistribution
adjustHistorySize, getAdjustableClone, hasInapplicable, hasInapplicable, hasMissing, hasMissing, isConstant, isConstant
 
Methods inherited from class mesquite.cont.lib.ContinuousStates
firstIsGreater, getCharacterDataClass, getCharacterState, getCharacterState, getDataTypeName, getDefaultModel, getStateClass, isInapplicable, isUnassigned, isUncertain, logStates, statesEqual, toString, userQueryItem
 
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, toString, 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

firstItem

protected DoubleArray firstItem

items

protected java.util.Vector items

numNodes

protected int numNodes
Constructor Detail

ContinuousAdjustable

public ContinuousAdjustable(Taxa taxa,
                            int numNodes)
Method Detail

getNumItems

public int getNumItems()
Specified by:
getNumItems in interface ItemContainer
Specified by:
getNumItems in class ContinuousStates

getNumTaxa

public int getNumTaxa()
Description copied from interface: CharacterStatesHolder
This is the same as getNumNodes. This may be unexpected, because it does NOT necessarily give the same results as getTaxa().getNumTaxa(). For instance, if this is a CharacterHistory, then this is the same as number of nodes, not the number of terminal taxa. The reason for this unusual usage is that

Specified by:
getNumTaxa in interface CharacterStatesHolder

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
Overrides:
getNumNodes in class ContinuousDistribution

addItem

public DoubleArray addItem(NameReference nr)

establishItem

public DoubleArray establishItem(java.lang.String name)

establishItem

public DoubleArray establishItem(NameReference nr)
Make an item with the passed name. If the an item already made is not yet named, then this will simply use this item and give it a new name. Otherwise, a new matrix is made for a new item, and the name is attached to it.


addItem

public DoubleArray addItem(java.lang.String name)

setItemsAs

public void setItemsAs(ItemContainer iCont)

removeItem

public void removeItem(int item)
Removes item.


setItemReference

public void setItemReference(int index,
                             NameReference nr)
Sets the name reference for the item number "index".


setItems

public void setItems(ContinuousAdjustable s)

setItems

public void setItems(java.lang.String[] names)

getItem

public DoubleArray getItem(int index)

getItemName

public java.lang.String getItemName(int index)
Specified by:
getItemName in interface ItemContainer
Specified by:
getItemName in class ContinuousStates

getItemReference

public NameReference getItemReference(java.lang.String name)
Specified by:
getItemReference in interface ItemContainer
Specified by:
getItemReference in class ContinuousStates

getItemReference

public NameReference getItemReference(int index)
Specified by:
getItemReference in interface ItemContainer
Specified by:
getItemReference in class ContinuousStates

getItemNumber

public int getItemNumber(NameReference nr)
Specified by:
getItemNumber in interface ItemContainer
Specified by:
getItemNumber in class ContinuousStates

deassignStates

public void deassignStates()
Description copied from interface: AdjustableDistribution
set all states to missing (unassigned)

Specified by:
deassignStates in interface AdjustableDistribution

getState

public double getState(int N,
                       int item)
Specified by:
getState in class ContinuousStates

getState

public double getState(int N)
Specified by:
getState in class ContinuousStates

setState

public void setState(int N,
                     int item,
                     double d)

setState

public void setState(int N,
                     double d)

setCharacterState

public void setCharacterState(int N,
                              CharacterState cs)
Description copied from interface: AdjustableDistribution
sets CharacterState at node/taxon it

Specified by:
setCharacterState in interface AdjustableDistribution

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