/** * Marshall a Chromosome instance to an XML Document representation, including its contained Gene * instances. * * @param a_subject the chromosome to represent as an XML document * @return a Document object representing the given Chromosome * @author Neil Rotstan * @since 1.0 * @deprecated use XMLDocumentBuilder instead */ public static Document representChromosomeAsDocument(final IChromosome a_subject) { // DocumentBuilders do not have to be thread safe, so we have to // protect creation of the Document with a synchronized block. // ------------------------------------------------------------- Document chromosomeDocument; synchronized (m_lock) { chromosomeDocument = m_documentCreator.newDocument(); } Element chromosomeElement = representChromosomeAsElement(a_subject, chromosomeDocument); chromosomeDocument.appendChild(chromosomeElement); return chromosomeDocument; }
/** * Marshall a Genotype to an XML Document representation, including its population of Chromosome * instances. * * @param a_subject the genotype to represent as an XML document * @return a Document object representing the given Genotype * @author Neil Rotstan * @since 1.0 * @deprecated use XMLDocumentBuilder instead */ public static Document representGenotypeAsDocument(final Genotype a_subject) { // DocumentBuilders do not have to be thread safe, so we have to // protect creation of the Document with a synchronized block. // ------------------------------------------------------------- Document genotypeDocument; synchronized (m_lock) { genotypeDocument = m_documentCreator.newDocument(); } Element genotypeElement = representGenotypeAsElement(a_subject, genotypeDocument); genotypeDocument.appendChild(genotypeElement); return genotypeDocument; }