org.jgap.data
Class DataTreeBuilder
- java.lang.Object
-
- org.jgap.data.DataTreeBuilder
-
public class DataTreeBuilder extends java.lang.ObjectBuilds a tree structure from Genes, Chrosomes or from a Genotype.Generated result is generic data type usable for concrete persistence strategies, including XML documents, writing an object to a file or stream etc.
- Since:
- 2.0
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description static DataTreeBuildergetInstance()IDataCreatorsrepresentChromosomeAsDocument(IChromosome a_subject)Represent a Chromosome as a generic data type document, including its contained Gene instances.IDataElementrepresentChromosomeAsElement(IChromosome a_subject)Represent a Chromosome as a generic data element, including its contained Gene instances.IDataElementrepresentGeneAsElement(Gene a_gene)Represent a Gene as a generic data element.IDataElementrepresentGenesAsElement(Gene[] a_geneValues)Represent Genes as a generic data type element.IDataCreatorsrepresentGenotypeAsDocument(Genotype a_subject)Represent a Genotype as a generic data document, including its population of Chromosome instances.IDataElementrepresentGenotypeAsElement(Genotype a_subject)Represent a Genotype as a generic data element, including its population of Chromosome instances.
-
-
-
Method Detail
-
getInstance
public static DataTreeBuilder getInstance()
- Returns:
- the singleton instance of this class
- Since:
- 2.0
-
representGenotypeAsDocument
public IDataCreators representGenotypeAsDocument(Genotype a_subject) throws java.lang.Exception
Represent a Genotype as a generic data document, including its population of Chromosome instances.- Parameters:
a_subject- the genotype to represent- Returns:
- a generic document object representing the given Genotype
- Throws:
java.lang.Exception- Since:
- 2.0
-
representGenotypeAsElement
public IDataElement representGenotypeAsElement(Genotype a_subject) throws java.lang.Exception
Represent a Genotype as a generic data element, including its population of Chromosome instances. This may be useful in scenarios where representation as an entire document is undesirable, such as when the representation of this Genotype is to be combined with other elements in a single document.- Parameters:
a_subject- the genotype to represent- Returns:
- an element object representing the given Genotype
- Throws:
java.lang.Exception- Since:
- 2.0
-
representChromosomeAsDocument
public IDataCreators representChromosomeAsDocument(IChromosome a_subject) throws java.lang.Exception
Represent a Chromosome as a generic data type document, including its contained Gene instances.- Parameters:
a_subject- the chromosome to represent- Returns:
- a document object representing the given Chromosome
- Throws:
java.lang.Exception- Since:
- 2.0
-
representChromosomeAsElement
public IDataElement representChromosomeAsElement(IChromosome a_subject) throws java.lang.Exception
Represent a Chromosome as a generic data element, including its contained Gene instances. This may be useful in scenarios where representation as an entire document is undesirable, such as when the representation of this Chromosome is to be combined with other elements in a single document.- Parameters:
a_subject- the chromosome to represent- Returns:
- an element object representing the given Chromosome
- Throws:
java.lang.Exception- Since:
- 2.0
-
representGenesAsElement
public IDataElement representGenesAsElement(Gene[] a_geneValues) throws java.lang.Exception
Represent Genes as a generic data type element.- Parameters:
a_geneValues- the genes to represent- Returns:
- an element object representing the given genes
- Throws:
java.lang.Exception- Since:
- 2.0
-
representGeneAsElement
public IDataElement representGeneAsElement(Gene a_gene) throws java.lang.Exception
Represent a Gene as a generic data element.- Parameters:
a_gene- the Gene to represent- Returns:
- an element object representing the given gene
- Throws:
java.lang.Exception- Since:
- 2.0
-
-
DMelt 3.0 © DataMelt by jWork.ORG