1 /*******************************************************************************
2 * Copyright (c) 2014 École Polytechnique de Montréal
4 * All rights reserved. This program and the accompanying materials are
5 * made available under the terms of the Eclipse Public License v1.0 which
6 * accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
10 * Geneviève Bastien - Initial API and implementation
11 *******************************************************************************/
13 package org
.eclipse
.tracecompass
.tmf
.analysis
.xml
.core
.model
;
15 import java
.util
.List
;
17 import org
.eclipse
.jdt
.annotation
.NonNull
;
18 import org
.eclipse
.jdt
.annotation
.Nullable
;
19 import org
.eclipse
.tracecompass
.statesystem
.core
.exceptions
.AttributeNotFoundException
;
20 import org
.eclipse
.tracecompass
.statesystem
.core
.exceptions
.StateValueTypeException
;
21 import org
.eclipse
.tracecompass
.statesystem
.core
.exceptions
.TimeRangeException
;
22 import org
.eclipse
.tracecompass
.statesystem
.core
.statevalue
.ITmfStateValue
;
23 import org
.eclipse
.tracecompass
.tmf
.core
.event
.ITmfEvent
;
26 * Interface that describe operations on a state value described in an XML
29 * @author Geneviève Bastien
31 public interface ITmfXmlStateValue
{
34 * Get the current {@link ITmfStateValue} of this state value for an event.
35 * It does not increment the value and does not any other processing of the
39 * The current event or <code>null</code> if no event is
41 * @return the {@link ITmfStateValue}
42 * @throws AttributeNotFoundException
43 * May be thrown by the state system during the query
45 ITmfStateValue
getValue(@Nullable ITmfEvent event
) throws AttributeNotFoundException
;
48 * Get the value of the event field that is the path of this state value
52 * @return the value of the event field
54 ITmfStateValue
getEventFieldValue(@NonNull ITmfEvent event
);
57 * Get the list of state attributes, the path to the state value
59 * @return the list of Attribute to have the path in the State System
61 List
<ITmfXmlStateAttribute
> getAttributes();
64 * Handles an event, by setting the value of the attribute described by the
65 * state attribute path in the state system.
68 * The event to process
69 * @throws AttributeNotFoundException
70 * Pass through the exception it received
71 * @throws TimeRangeException
72 * Pass through the exception it received
73 * @throws StateValueTypeException
74 * Pass through the exception it received
76 void handleEvent(@NonNull ITmfEvent event
) throws AttributeNotFoundException
, StateValueTypeException
, TimeRangeException
;