mesquite.cont.lib
Class ContinuousState

java.lang.Object
  extended by mesquite.lib.characters.CharacterState
      extended by mesquite.cont.lib.ContinuousState
All Implemented Interfaces:
ItemContainer
Direct Known Subclasses:
GeographicState

public class ContinuousState
extends CharacterState
implements ItemContainer

This class provides some basic utilities for Continuous characters. It represents the entry for one character and one taxon. Thus, it can contain more than one item (min, max, mean, variance, etc.).


Field Summary
static double impossible
          The state (MesquiteDouble.impossible) that corresponds to an impossible value.
static double inapplicable
          The state (MesquiteDouble.inapplicable) that corresponds to a gap (inapplicable data).
static double infinite
          The state (MesquiteDouble.infinite) that corresponds to infinite.
static int MAXITEMS
          The maximum allowed number of items
static double unassigned
          The state (MesquiteDouble.unassigned) that corresponds to missing data.
 
Constructor Summary
ContinuousState()
           
ContinuousState(double value)
           
 
Method Summary
static double absolute(double d)
           
 boolean equals(CharacterState s)
          returns true iff state sets are same
 boolean equals(CharacterState s, boolean allowMissing)
          returns true iff state sets are same
 boolean equals(CharacterState s, boolean allowMissing, boolean allowNearExact)
          returns true iff state sets are same
 java.lang.Class getCharacterDataClass()
          returns the subclass of CharacterData that is equivalent to this character type (i.e., in which sort of matrix would this character state reside?
 java.lang.Class getCharacterDistributionClass()
          returns the subclass of CharacterDistribution that is equivalent to this character type (i.e., in which sort of Distribution would this character state reside?.
 java.lang.Class getCharacterHistoryClass()
          returns the subclass of CharacterHistory that is equivalent to this character type (i.e., in which sort of Distribution would this character state reside?
 java.lang.String getDataTypeName()
          returns the name of the type of data stored
 java.lang.String getItemName(int n)
          gets name of item n
 int getItemNumber(NameReference nr)
          returns which item number has NameReference nr nr
 NameReference getItemReference(int n)
          gets NameReferece of item n
 NameReference getItemReference(java.lang.String name)
          gets NameReferece of item n
 java.lang.Class getMCharactersDistributionClass()
          returns the subclass of MCharactersDistribution that is equivalent to this character type (i.e., in which sort of matrix would this character state reside?
 int getNumItems()
          returns the number of items (min, max, mean, variance, etc.) in this state
 double getValue(int n)
          gets the value of item # n
 double getValue(NameReference nr)
          gets the name value of item with NameReference NR
 boolean isCombinable()
          returns true if at least one item is combinable (i.e.
static boolean isCombinable(double d)
          returns whether value is combinable (i.e.
 boolean isImpossible()
          returns true if at least one item is invalid
static boolean isImpossible(double s)
          returns true if value is invalid
 boolean isInapplicable()
          returns true if all items are inapplicable
static boolean isInapplicable(double s)
          returns true if inapplicable
 boolean isUnassigned()
          returns true if all items have missing data (unassigned)
static boolean isUnassigned(double s)
          returns true if missing data (unassigned)
 AdjustableDistribution makeAdjustableDistribution(Taxa taxa, int numNodes)
          returns a AdjustableDistribution that is equivalent to this character type (i.e., in which sort of matrix would this character state reside?
 CharacterHistory makeCharacterHistory(Taxa taxa, int numNodes)
          returns a CharacterHistory that is equivalent to this character type (i.e., in which sort of matrix would this character state reside?
static double maximum(double d1, double d2)
           
static double minimum(double d1, double d2)
           
 void setItemReference(int n, NameReference nr)
          sets NameReference of item n
 void setItemsAs(ItemContainer iCont)
           
 void setNumItems(int n)
          sets the number of items in this state
 void setToInapplicable()
          sets the value to inapplicable
 void setToUnassigned()
          sets the value to unassigned
 void setValue(CharacterState cs)
          sets its value to the value in CharacterState passed to it
 void setValue(int n, double d)
          sets value of item n
 void setValue(java.lang.String st, CharacterData parentData)
          sets its value to the value given by the String passed to it
 void setValue(java.lang.String st, MesquiteInteger pos)
          sets its value to the value given by the String passed to it starting at position pos
 java.lang.String toDisplayString()
          Returns string as would be displayed to user (not necessarily internal shorthand).
 java.lang.String toString()
          returns string representation of the character state
 
Methods inherited from class mesquite.lib.characters.CharacterState
equals, makeMCharactersDistribution
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

unassigned

public static final double unassigned
The state (MesquiteDouble.unassigned) that corresponds to missing data.

See Also:
Constant Field Values

inapplicable

public static final double inapplicable
The state (MesquiteDouble.inapplicable) that corresponds to a gap (inapplicable data).

See Also:
Constant Field Values

infinite

public static final double infinite
The state (MesquiteDouble.infinite) that corresponds to infinite.

See Also:
Constant Field Values

impossible

public static final double impossible
The state (MesquiteDouble.impossible) that corresponds to an impossible value. This is returned when a value is invalid, e.g. a string is parsed for a number but no valid number is found.

See Also:
Constant Field Values

MAXITEMS

public static final int MAXITEMS
The maximum allowed number of items

See Also:
Constant Field Values
Constructor Detail

ContinuousState

public ContinuousState()

ContinuousState

public ContinuousState(double value)
Method Detail

getDataTypeName

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

Specified by:
getDataTypeName in class CharacterState

getNumItems

public int getNumItems()
returns the number of items (min, max, mean, variance, etc.) in this state

Specified by:
getNumItems in interface ItemContainer

setNumItems

public void setNumItems(int n)
sets the number of items in this state


getItemName

public java.lang.String getItemName(int n)
gets name of item n

Specified by:
getItemName in interface ItemContainer

getItemReference

public NameReference getItemReference(java.lang.String name)
gets NameReferece of item n

Specified by:
getItemReference in interface ItemContainer

getItemReference

public NameReference getItemReference(int n)
gets NameReferece of item n

Specified by:
getItemReference in interface ItemContainer

setItemReference

public void setItemReference(int n,
                             NameReference nr)
sets NameReference of item n


getItemNumber

public int getItemNumber(NameReference nr)
returns which item number has NameReference nr nr

Specified by:
getItemNumber in interface ItemContainer

setItemsAs

public void setItemsAs(ItemContainer iCont)

getCharacterDataClass

public java.lang.Class getCharacterDataClass()
Description copied from class: CharacterState
returns the subclass of CharacterData that is equivalent to this character type (i.e., in which sort of matrix would this character state reside?

Specified by:
getCharacterDataClass in class CharacterState

getMCharactersDistributionClass

public java.lang.Class getMCharactersDistributionClass()
Description copied from class: CharacterState
returns the subclass of MCharactersDistribution that is equivalent to this character type (i.e., in which sort of matrix would this character state reside?

Specified by:
getMCharactersDistributionClass in class CharacterState

getCharacterDistributionClass

public java.lang.Class getCharacterDistributionClass()
Description copied from class: CharacterState
returns the subclass of CharacterDistribution that is equivalent to this character type (i.e., in which sort of Distribution would this character state reside?. Should return an MAdjustableDistribution

Specified by:
getCharacterDistributionClass in class CharacterState

getCharacterHistoryClass

public java.lang.Class getCharacterHistoryClass()
Description copied from class: CharacterState
returns the subclass of CharacterHistory that is equivalent to this character type (i.e., in which sort of Distribution would this character state reside?

Specified by:
getCharacterHistoryClass in class CharacterState

makeAdjustableDistribution

public AdjustableDistribution makeAdjustableDistribution(Taxa taxa,
                                                         int numNodes)
Description copied from class: CharacterState
returns a AdjustableDistribution that is equivalent to this character type (i.e., in which sort of matrix would this character state reside?

Specified by:
makeAdjustableDistribution in class CharacterState

makeCharacterHistory

public CharacterHistory makeCharacterHistory(Taxa taxa,
                                             int numNodes)
Description copied from class: CharacterState
returns a CharacterHistory that is equivalent to this character type (i.e., in which sort of matrix would this character state reside?

Specified by:
makeCharacterHistory in class CharacterState

isUnassigned

public static boolean isUnassigned(double s)
returns true if missing data (unassigned)


isUnassigned

public boolean isUnassigned()
returns true if all items have missing data (unassigned)

Specified by:
isUnassigned in class CharacterState

isInapplicable

public static boolean isInapplicable(double s)
returns true if inapplicable


isInapplicable

public boolean isInapplicable()
returns true if all items are inapplicable

Specified by:
isInapplicable in class CharacterState

isImpossible

public static boolean isImpossible(double s)
returns true if value is invalid


isImpossible

public boolean isImpossible()
returns true if at least one item is invalid

Specified by:
isImpossible in class CharacterState

isCombinable

public boolean isCombinable()
returns true if at least one item is combinable (i.e. a valid assigned state).

Specified by:
isCombinable in class CharacterState

isCombinable

public static boolean isCombinable(double d)
returns whether value is combinable (i.e. a valid assigned state) or not.


equals

public boolean equals(CharacterState s)
returns true iff state sets are same

Specified by:
equals in class CharacterState

equals

public boolean equals(CharacterState s,
                      boolean allowMissing)
returns true iff state sets are same

Specified by:
equals in class CharacterState

equals

public boolean equals(CharacterState s,
                      boolean allowMissing,
                      boolean allowNearExact)
returns true iff state sets are same

Specified by:
equals in class CharacterState

absolute

public static double absolute(double d)

maximum

public static double maximum(double d1,
                             double d2)

minimum

public static double minimum(double d1,
                             double d2)

setToInapplicable

public void setToInapplicable()
sets the value to inapplicable

Specified by:
setToInapplicable in class CharacterState

setToUnassigned

public void setToUnassigned()
sets the value to unassigned

Specified by:
setToUnassigned in class CharacterState

setValue

public void setValue(int n,
                     double d)
sets value of item n


setValue

public void setValue(CharacterState cs)
Description copied from class: CharacterState
sets its value to the value in CharacterState passed to it

Specified by:
setValue in class CharacterState

setValue

public void setValue(java.lang.String st,
                     CharacterData parentData)
Description copied from class: CharacterState
sets its value to the value given by the String passed to it

Specified by:
setValue in class CharacterState

getValue

public double getValue(int n)
gets the value of item # n


getValue

public double getValue(NameReference nr)
gets the name value of item with NameReference NR


setValue

public void setValue(java.lang.String st,
                     MesquiteInteger pos)
Description copied from class: CharacterState
sets its value to the value given by the String passed to it starting at position pos

Specified by:
setValue in class CharacterState

toString

public java.lang.String toString()
Description copied from class: CharacterState
returns string representation of the character state

Specified by:
toString in class CharacterState

toDisplayString

public java.lang.String toDisplayString()
Returns string as would be displayed to user (not necessarily internal shorthand).

Specified by:
toDisplayString in class CharacterState