[Mmil-commits] r82 - trunk/src/fr/loria/talaris/mmil/iterators

alexandredenis at users.gforge.inria.fr alexandredenis at users.gforge.inria.fr
Mar 14 Déc 20:01:45 CET 2010


Author: alexandredenis
Date: 2010-12-14 20:01:45 +0100 (Tue, 14 Dec 2010)
New Revision: 82

Modified:
   trunk/src/fr/loria/talaris/mmil/iterators/EventIndexMMILIterator.java
   trunk/src/fr/loria/talaris/mmil/iterators/IndexMMILIterator.java
   trunk/src/fr/loria/talaris/mmil/iterators/ParticipantIndexMMILIterator.java
Log:
Fixed next()

Modified: trunk/src/fr/loria/talaris/mmil/iterators/EventIndexMMILIterator.java
===================================================================
--- trunk/src/fr/loria/talaris/mmil/iterators/EventIndexMMILIterator.java	2010-12-14 18:52:43 UTC (rev 81)
+++ trunk/src/fr/loria/talaris/mmil/iterators/EventIndexMMILIterator.java	2010-12-14 19:01:45 UTC (rev 82)
@@ -1,5 +1,7 @@
 package fr.loria.talaris.mmil.iterators;
 
+import java.util.NoSuchElementException;
+
 import fr.loria.talaris.mmil.*;
 
 /**
@@ -18,4 +20,12 @@
 	{
 		super(mmil.getEvents());
 	}
+	
+	@Override
+	public MMILEvent next()
+	{
+		if (hasNext())
+			return (MMILEvent) iteratorEntities.get(currentIndex++);
+		else throw new NoSuchElementException();
+	}
 }

Modified: trunk/src/fr/loria/talaris/mmil/iterators/IndexMMILIterator.java
===================================================================
--- trunk/src/fr/loria/talaris/mmil/iterators/IndexMMILIterator.java	2010-12-14 18:52:43 UTC (rev 81)
+++ trunk/src/fr/loria/talaris/mmil/iterators/IndexMMILIterator.java	2010-12-14 19:01:45 UTC (rev 82)
@@ -11,8 +11,8 @@
  */
 public class IndexMMILIterator implements MMILIterator
 {
-	private int currentIndex;
-	private List<MMILEntity> iteratorEntities;
+	protected int currentIndex;
+	protected List<MMILEntity> iteratorEntities;
 
 
 	/**

Modified: trunk/src/fr/loria/talaris/mmil/iterators/ParticipantIndexMMILIterator.java
===================================================================
--- trunk/src/fr/loria/talaris/mmil/iterators/ParticipantIndexMMILIterator.java	2010-12-14 18:52:43 UTC (rev 81)
+++ trunk/src/fr/loria/talaris/mmil/iterators/ParticipantIndexMMILIterator.java	2010-12-14 19:01:45 UTC (rev 82)
@@ -1,5 +1,7 @@
 package fr.loria.talaris.mmil.iterators;
 
+import java.util.NoSuchElementException;
+
 import fr.loria.talaris.mmil.*;
 
 /**
@@ -18,4 +20,12 @@
 	{
 		super(mmil.getParticipants());
 	}
+	
+	@Override
+	public MMILParticipant next()
+	{
+		if (hasNext())
+			return (MMILParticipant) iteratorEntities.get(currentIndex++);
+		else throw new NoSuchElementException();
+	}
 }




More information about the Mmil-commits mailing list