import java.util.HashMap;
import java.util.HashSet;
+import java.util.Map;
import java.util.Set;
import org.eclipse.linuxtools.ctf.core.event.IEventDeclaration;
import org.eclipse.linuxtools.ctf.core.event.types.StructDeclaration;
+import org.eclipse.linuxtools.internal.ctf.core.event.EventDeclaration;
import org.eclipse.linuxtools.internal.ctf.core.event.metadata.exceptions.ParseException;
/**
/**
* Maps event ids to events
*/
- private HashMap<Long, IEventDeclaration> events = new HashMap<Long, IEventDeclaration>();
+ private Map<Long, IEventDeclaration> events = new HashMap<Long, IEventDeclaration>();
/**
* The inputs associated to this stream
*
* @return all the event declarations for this stream, using the id as a key for the hashmap.
*/
- public HashMap<Long, IEventDeclaration> getEvents() {
+ public Map<Long, IEventDeclaration> getEvents() {
return events;
}
if (events.get(event.getId()) != null) {
throw new ParseException("Event id already exists"); //$NON-NLS-1$
}
-
- /* Put the event in the map */
- events.put(event.getId(), event);
+ if (event.getId() == null) {
+ events.put(EventDeclaration.UNSET_EVENT_ID, event);
+ } else {
+ /* Put the event in the map */
+ events.put(event.getId(), event);
+ }
}
/**