/*******************************************************************************\r
* Copyright (c) 2012 Ericsson\r
- * \r
+ *\r
* All rights reserved. This program and the accompanying materials are\r
* made available under the terms of the Eclipse Public License v1.0 which\r
* accompanies this distribution, and is available at\r
* http://www.eclipse.org/legal/epl-v10.html\r
- * \r
+ *\r
* Contributors:\r
* Patrick Tasse - Initial API and implementation\r
*******************************************************************************/\r
import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.ITimeEvent;\r
import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.TimeEvent;\r
\r
+/**\r
+ * An iterator for time events\r
+ */\r
public class EventIterator implements Iterator<ITimeEvent> {\r
\r
- private long fStartTime;\r
- private long fEndTime;\r
+ private final long fStartTime;\r
+ private final long fEndTime;\r
private List<ITimeEvent> fEventList;\r
private List<ITimeEvent> fZoomedEventList;\r
private long fZoomedStartTime;\r
private ITimeEvent fNext = null;\r
private ITimeEvent fZoomedNext = null;\r
\r
+ /**\r
+ * Basic constructor, with start time and end times equal to the lowest and\r
+ * highest values possible, respectively.\r
+ *\r
+ * @param eventList\r
+ * The list on which this iterator will iterate\r
+ * @param zoomedEventList\r
+ * The "zoomed" list\r
+ */\r
public EventIterator(List<ITimeEvent> eventList, List<ITimeEvent> zoomedEventList) {\r
this(eventList, zoomedEventList, Long.MIN_VALUE, Long.MAX_VALUE);\r
}\r
\r
- public EventIterator(List<ITimeEvent> eventList, List<ITimeEvent> zoomedEventList, long startTime, long endTime) {\r
+ /**\r
+ * Complete constructor, where we specify start and end times.\r
+ *\r
+ * @param eventList\r
+ * The list on which this iterator will iterate\r
+ * @param zoomedEventList\r
+ * The "zoomed" list\r
+ * @param startTime\r
+ * The start time\r
+ * @param endTime\r
+ * The end time\r
+ */\r
+ public EventIterator(List<ITimeEvent> eventList,\r
+ List<ITimeEvent> zoomedEventList, long startTime, long endTime) {\r
fEventList = eventList;\r
fZoomedEventList = zoomedEventList;\r
if (zoomedEventList != null && zoomedEventList.size() > 0) {\r