package be.shoktan.BeeBreedingManager.model;

import java.util.Iterator;

import javax.persistence.Entity;

/**
 * Model class representing a specie of a bee
 * @author Wisthy
 *
 */
@Entity
public class Specie extends Specification {

	/*
	 * (non-Javadoc)
	 * @see be.shoktan.BeeBreedingManager.model.Specification#getType()
	 */
	@Override
	protected ESpecificationType getType() {
		return ESpecificationType.specie;
	}

	/*
	 * (non-Javadoc)
	 * @see be.shoktan.BeeBreedingManager.model.Specification#iterator()
	 */
	@Override
	public Iterator<Specification> iterator() {
		return new SpecieIterator(this);
	}
	
	private class SpecieIterator implements Iterator<Specification>{
		private boolean done = false;
		private Specie root;
		
		/**
		 * @param root
		 */
		public SpecieIterator(Specie root) {
			super();
			this.root = root;
		}

		/*
		 * (non-Javadoc)
		 * @see java.util.Iterator#hasNext()
		 */
		@Override
		public boolean hasNext() {
			return !done;
		}

		/*
		 * (non-Javadoc)
		 * @see java.util.Iterator#next()
		 */
		@Override
		public Specification next() {
			done = true;
			return root;
		}

		/*
		 * (non-Javadoc)
		 * @see java.util.Iterator#remove()
		 */
		@Override
		public void remove() {
			// TODO Auto-generated method stub
			
		}
		
		
	}

}

@@ -39,16 +39,73 @@
 model;%0A%0A
+import java.util.ArrayList;%0Aimport java.util.Collection;%0A
 import j
@@ -123,16 +123,16 @@
 erator;%0A
-
 %0Aimport 
@@ -668,16 +668,357 @@
 );%0A%09%7D%0A%09%0A
+%09public Collection%3CSpecie%3E mutationResultWith(Specie second) %7B%0A%09%09if(second == null)%7B%0A%09%09%09return null;%0A%09%09%7D%0A%09%09%0A%09%09Collection%3CSpecie%3E result = new ArrayList%3C%3E();%0A%09%09%0A%09%09for(Mutation m : this.getMutations())%7B%0A%09%09%09Specification other = m.getOther(this);%0A%09%09%09if(second.equals(other))%7B%0A%09%09%09%09result.addAll(m.getResult());%0A%09%09%09%7D%0A%09%09%7D%0A%09%09%0A%09%09return result;%0A%09%7D%0A%09%0A
 %09private
@@ -1675,14 +1675,17 @@
 %7D%0A%09%09%0A%09%09%0A
-
 %09%7D%0A%0A
+%09%0A%0A
 %7D%0A

Update Specie.java