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

alexandredenis at users.gforge.inria.fr alexandredenis at users.gforge.inria.fr
Mar 14 Déc 19:52:43 CET 2010


Author: alexandredenis
Date: 2010-12-14 19:52:43 +0100 (Tue, 14 Dec 2010)
New Revision: 81

Added:
   trunk/src/fr/loria/talaris/mmil/iterators/EventIndexMMILIterator.java
   trunk/src/fr/loria/talaris/mmil/iterators/ParticipantIndexMMILIterator.java
Modified:
   trunk/src/fr/loria/talaris/mmil/iterators/IndexMMILIterator.java
Log:
Added a ParticipantIndexMMILIterator and an EventIndexMMILIterator

Added: trunk/src/fr/loria/talaris/mmil/iterators/EventIndexMMILIterator.java
===================================================================
--- trunk/src/fr/loria/talaris/mmil/iterators/EventIndexMMILIterator.java	                        (rev 0)
+++ trunk/src/fr/loria/talaris/mmil/iterators/EventIndexMMILIterator.java	2010-12-14 18:52:43 UTC (rev 81)
@@ -0,0 +1,21 @@
+package fr.loria.talaris.mmil.iterators;
+
+import fr.loria.talaris.mmil.*;
+
+/**
+ * An EventIndexMMILIterator is an IndexMMILIterator restricted to the
+ * events of a component.
+ * @author Alexandre Denis
+ */
+public class EventIndexMMILIterator extends IndexMMILIterator
+{
+	/**
+	 * Creates an EventIndexMMILIterator over the events of the given
+	 * component.
+	 * @param mmil
+	 */
+	public EventIndexMMILIterator(MMILComponent mmil)
+	{
+		super(mmil.getEvents());
+	}
+}

Modified: trunk/src/fr/loria/talaris/mmil/iterators/IndexMMILIterator.java
===================================================================
--- trunk/src/fr/loria/talaris/mmil/iterators/IndexMMILIterator.java	2010-12-14 18:45:57 UTC (rev 80)
+++ trunk/src/fr/loria/talaris/mmil/iterators/IndexMMILIterator.java	2010-12-14 18:52:43 UTC (rev 81)
@@ -21,8 +21,18 @@
 	 */
 	public IndexMMILIterator(MMILComponent mmil)
 	{
+		this(mmil.getEntities());
+	}
+	
+	
+	/**
+	 * Creates an IndexMMILIterator over the given entities.
+	 * @param mmil
+	 */
+	public IndexMMILIterator(Collection<? extends MMILEntity> entities)
+	{
 		currentIndex = 0;
-		iteratorEntities = new ArrayList<MMILEntity>(mmil.getEntities());
+		iteratorEntities = new ArrayList<MMILEntity>(entities);
 		Collections.sort(iteratorEntities, new Comparator<MMILEntity>()
 		{
 			@Override
@@ -32,6 +42,7 @@
 			}
 		});
 	}
+	
 
 
 	@Override

Added: trunk/src/fr/loria/talaris/mmil/iterators/ParticipantIndexMMILIterator.java
===================================================================
--- trunk/src/fr/loria/talaris/mmil/iterators/ParticipantIndexMMILIterator.java	                        (rev 0)
+++ trunk/src/fr/loria/talaris/mmil/iterators/ParticipantIndexMMILIterator.java	2010-12-14 18:52:43 UTC (rev 81)
@@ -0,0 +1,21 @@
+package fr.loria.talaris.mmil.iterators;
+
+import fr.loria.talaris.mmil.*;
+
+/**
+ * A ParticipantIndexMMILIterator is an IndexMMILIterator restricted to the
+ * participants of a component.
+ * @author Alexandre Denis
+ */
+public class ParticipantIndexMMILIterator extends IndexMMILIterator
+{
+	/**
+	 * Creates a ParticipantIndexMMILIterator over the participants of the given
+	 * component.
+	 * @param mmil
+	 */
+	public ParticipantIndexMMILIterator(MMILComponent mmil)
+	{
+		super(mmil.getParticipants());
+	}
+}




More information about the Mmil-commits mailing list