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 TypeMethodDescriptionvoid
add a taxon with this charactergetDesc()
return the description of the charactergetName()
return the name of the characterdouble
getStateDesc
(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 characterboolean
void
set the description of the charactervoid
setIsOrdered
(boolean isOrdered) void
set the name of the charactervoid
setNumOfStates
(int numOfStates) void
setStateDesc
(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:Character
set the name of the character -
getName
Description copied from interface:Character
return the name of the character -
setDesc
Description copied from interface:Character
set the description of the character -
getDesc
Description copied from interface:Character
return the description of the character -
getType
Description copied from interface:Character
return the CharacterType of the character -
addTaxon
Description copied from interface:Character
add a taxon with this character -
getValue
Description copied from interface:Character
get 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:Character
get a Setof all the taxa for this character -
setStateDesc
- Parameters:
stateDesc
- a Map<Integer, String> of the state descriptions corresponding to the values
-
getStateDesc
- Returns:
- the Map<Integer, String> of the state descriptions corresponding to the values
-
getStateDesc
- Parameters:
state
- corresponding to the state- Returns:
- state description
-