Package jebl.evolution.characters
Class DiscreteCharacter
java.lang.Object
jebl.evolution.characters.DiscreteCharacter
- All Implemented Interfaces:
Character
- Author:
- Stephen A. Smith
-
Constructor Summary
ConstructorsConstructorDescriptionDiscreteCharacter(String name, String desc, int numOfStates) Constructs a basic DiscreteCharacter object with no taxa added yetDiscreteCharacter(String name, String desc, int numOfStates, Set<Taxon> taxa) Constructs a basic DiscreteCharacter object with taxa -
Method Summary
Modifier and TypeMethodDescriptionvoidadd a taxon with this charactergetDesc()return the description of the charactergetName()return the name of the characterdoublegetStateDesc(int state) getTaxa()get a Setof all the taxa for this character getType()return the CharacterType of the characterget a value for a taxon containing the characterbooleanvoidset the description of the charactervoidsetIsOrdered(boolean isOrdered) voidset the name of the charactervoidsetNumOfStates(int numOfStates) voidsetStateDesc(Map<Integer, String> stateDesc)
-
Constructor Details
-
DiscreteCharacter
Constructs a basic DiscreteCharacter object with no taxa added yet- Parameters:
name- the name of the characterdesc- the description of the characternumOfStates- the number of possible states for the character
-
DiscreteCharacter
Constructs a basic DiscreteCharacter object with taxa- Parameters:
name- the name of the characterdesc- the description of the characternumOfStates- the number of possible states for the charactertaxa- the Setcontaining the taxa with this character
-
-
Method Details
-
setName
Description copied from interface:Characterset the name of the character -
getName
Description copied from interface:Characterreturn the name of the character -
setDesc
Description copied from interface:Characterset the description of the character -
getDesc
Description copied from interface:Characterreturn the description of the character -
getType
Description copied from interface:Characterreturn the CharacterType of the character -
addTaxon
Description copied from interface:Characteradd a taxon with this character -
getValue
Description copied from interface:Characterget a value for a taxon containing the character -
isOrdered
public boolean isOrdered()- Returns:
- whether character is ordered or not
-
setIsOrdered
public void setIsOrdered(boolean isOrdered) - Parameters:
isOrdered- set whether character is ordered or not
-
getNumOfStates
public double getNumOfStates()- Returns:
- the number of possible states for the character
-
setNumOfStates
public void setNumOfStates(int numOfStates) - Parameters:
numOfStates- the number of possible states for the characeter
-
getTaxa
Description copied from interface:Characterget a Setof all the taxa for this character -
setStateDesc
- Parameters:
stateDesc- a Mapinvalid input: '<'Integer, String> of the state descriptions corresponding to the values
-
getStateDesc
- Returns:
- the Mapinvalid input: '<'Integer, String> of the state descriptions corresponding to the values
-
getStateDesc
- Parameters:
state- corresponding to the state- Returns:
- state description
-