Package jebl.evolution.characters
Class DiscreteCharacter
- java.lang.Object
-
- jebl.evolution.characters.DiscreteCharacter
-
-
Constructor Summary
Constructors Constructor Description DiscreteCharacter(java.lang.String name, java.lang.String desc, int numOfStates)
Constructs a basic DiscreteCharacter object with no taxa added yetDiscreteCharacter(java.lang.String name, java.lang.String desc, int numOfStates, java.util.Set<Taxon> taxa)
Constructs a basic DiscreteCharacter object with taxa
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addTaxon(Taxon taxon)
add a taxon with this characterjava.lang.String
getDesc()
return the description of the characterjava.lang.String
getName()
return the name of the characterdouble
getNumOfStates()
java.util.Map<java.lang.Integer,java.lang.String>
getStateDesc()
java.lang.String
getStateDesc(int state)
java.util.Set<Taxon>
getTaxa()
get a Setof all the taxa for this character CharacterType
getType()
return the CharacterType of the characterjava.lang.Object
getValue(Taxon taxon)
get a value for a taxon containing the characterboolean
isOrdered()
void
setDesc(java.lang.String desc)
set the description of the charactervoid
setIsOrdered(boolean isOrdered)
void
setName(java.lang.String name)
set the name of the charactervoid
setNumOfStates(int numOfStates)
void
setStateDesc(java.util.Map<java.lang.Integer,java.lang.String> stateDesc)
-
-
-
Constructor Detail
-
DiscreteCharacter
public DiscreteCharacter(java.lang.String name, java.lang.String desc, int numOfStates)
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
public DiscreteCharacter(java.lang.String name, java.lang.String desc, int numOfStates, java.util.Set<Taxon> taxa)
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 Detail
-
setName
public void setName(java.lang.String name)
Description copied from interface:Character
set the name of the character
-
getName
public java.lang.String getName()
Description copied from interface:Character
return the name of the character
-
setDesc
public void setDesc(java.lang.String desc)
Description copied from interface:Character
set the description of the character
-
getDesc
public java.lang.String getDesc()
Description copied from interface:Character
return the description of the character
-
getType
public CharacterType getType()
Description copied from interface:Character
return the CharacterType of the character
-
addTaxon
public void addTaxon(Taxon taxon)
Description copied from interface:Character
add a taxon with this character
-
getValue
public java.lang.Object getValue(Taxon taxon)
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
public java.util.Set<Taxon> getTaxa()
Description copied from interface:Character
get a Setof all the taxa for this character
-
setStateDesc
public void setStateDesc(java.util.Map<java.lang.Integer,java.lang.String> stateDesc)
- Parameters:
stateDesc
- a Mapof the state descriptions corresponding to the values
-
getStateDesc
public java.util.Map<java.lang.Integer,java.lang.String> getStateDesc()
- Returns:
- the Map
of the state descriptions corresponding to the values
-
getStateDesc
public java.lang.String getStateDesc(int state)
- Parameters:
state
- corresponding to the state- Returns:
- state description
-
-