lphy.base.function.alignment.NCharFunction Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of lphy-base Show documentation
Show all versions of lphy-base Show documentation
The standard library of LPhy, which contains the required generative distributions and basic functions.
The newest version!
package lphy.base.function.alignment;
import lphy.base.evolution.NChar;
import lphy.core.model.DeterministicFunction;
import lphy.core.model.Value;
import lphy.core.model.annotation.GeneratorInfo;
import lphy.core.model.annotation.ParameterInfo;
import lphy.core.model.datatype.IntegerValue;
@Deprecated
public class NCharFunction extends DeterministicFunction {
private static final String sitesParamName = "sites";
public NCharFunction(@ParameterInfo(name = sitesParamName, verb = "of", description = "a site-dimensioned object (e.g. alignment) or an array of site-dimensioned objects.") Value sites) {
setParam(sitesParamName, sites);
}
@Deprecated
@GeneratorInfo(name = "nchar", verbClause = "is", narrativeName = "number of characters", description = "The number of sites in the given alignment.")
public Value apply() {
Value sites = getParams().get(sitesParamName);
NChar value = sites.value();
return new IntegerValue(value.nchar(), this);
}
}