Ejemplo n.º 1
0
  @Override
  public WaveletChromatid clone() {
    try {
      final WaveletChromatid copy = (WaveletChromatid) super.clone();

      copy.centromerePosition = this.centromerePosition;
      copy.mutability = this.mutability;

      copy.sequencedGenes = new ArrayList<AbstractWaveletGene>();
      copy.promoters = new ArrayList<PromoterGene>();
      copy.localSignalGenes = new ArrayList<SignalGene>();
      copy.externalSignalGenes = new ArrayList<ExternalSignalGene>();

      for (AbstractWaveletGene currentGene : this.sequencedGenes)
        copy.sequencedGenes.add(currentGene.clone());
      for (PromoterGene currentGene : this.promoters) copy.promoters.add(currentGene.clone());
      for (SignalGene currentGene : this.localSignalGenes)
        copy.localSignalGenes.add(currentGene.clone());
      for (ExternalSignalGene currentGene : this.externalSignalGenes)
        copy.externalSignalGenes.add(currentGene.clone());

      return copy;
    } catch (CloneNotSupportedException caught) {
      LOGGER.error("CloneNotSupportedException caught but not expected!", caught);
      throw new UnexpectedDannError("CloneNotSupportedException caught but not expected", caught);
    }
  }
Ejemplo n.º 2
0
  public WaveletChromatid(WaveletChromatid copy) {
    this.centromerePosition = copy.centromerePosition;
    this.mutability = copy.mutability;

    this.sequencedGenes = new ArrayList<AbstractWaveletGene>();
    this.promoters = new ArrayList<PromoterGene>();
    this.localSignalGenes = new ArrayList<SignalGene>();
    this.externalSignalGenes = new ArrayList<ExternalSignalGene>();

    for (AbstractWaveletGene currentGene : copy.sequencedGenes)
      this.sequencedGenes.add(currentGene.clone());
    for (PromoterGene currentGene : copy.promoters) this.promoters.add(currentGene.clone());
    for (SignalGene currentGene : copy.localSignalGenes)
      this.localSignalGenes.add(currentGene.clone());
    for (ExternalSignalGene currentGene : copy.externalSignalGenes)
      this.externalSignalGenes.add(currentGene.clone());
  }