All Downloads are FREE. Search and download functionalities are using the official Maven repository.

toxgene.core.genes.trees.ToxOption Maven / Gradle / Ivy

/**
 * Implements a gene for an option in a tox-alternatives element.
 *
 * @author Denilson Barbosa
 * @version 0.1
 */

package toxgene.core.genes.trees;


import java.io.PrintStream;
import java.util.Vector;

import toxgene.core.genes.ContainerGene;
import toxgene.core.genes.Gene;
import toxgene.core.genes.lists.ListGene;
import toxgene.core.genes.lists.ToxListElement;
import toxgene.core.genes.lists.ToxListElementException;

public class ToxOption implements TreeGene, ListGene, ContainerGene{
  private Vector contents;
  private Vector attributes;

  public ToxOption(){
		contents = new Vector();
		attributes = new Vector();
  }

  /**
   * Resets the gene.
   */
  public void reset(){
		for (int i=0; i 0);
  }
  
  public void addElement(Gene gene){
		contents.add(gene);
  }

  public void addAttribute(Gene gene){
		attributes.add(gene);
  }

  public String getType(){
		if (contents.size() == 1){
			return ((ListGene)contents.get(0)).getType();
		}
		else{
			return "complex";
		}
  }

  public String name(){
		return "tox-option";
  }

  public Vector children(){
		return contents;
  }

  public Vector getChildren(){
		Vector result = null;
		for (int i=0; i




© 2015 - 2025 Weber Informatics LLC | Privacy Policy