-
Notifications
You must be signed in to change notification settings - Fork 10
/
InterruptionReason.java
47 lines (42 loc) · 1.5 KB
/
InterruptionReason.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/*******************************************************************************
* Copyright (c) 2016 École Polytechnique de Montréal
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License 2.0 which
* accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*******************************************************************************/
package org.eclipse.tracecompass.incubator.internal.xaf.core.statemachine.variable.utils;
/**
* Abstract class to represent an interruption. Derived classes will be used
* with their specificity to represent interruption reasons such as our task
* entering in blocked status or being preempted.
*
* @author Raphaël Beamonte
*/
public abstract class InterruptionReason implements Comparable<InterruptionReason> {
/**
* @return The full ID of the interruption reason
*/
public abstract String getID();
/**
* @return The short ID of the interruption reason
*/
public String getShortID() {
return getID();
}
/**
* @return The task ID of the interruption reason
*/
public abstract String getTaskId();
/**
* @param ir
* The interruption reason to use for comparison
* @return Whether another interruption reason fits or not in this one
*/
public boolean fits(InterruptionReason ir) {
return equals(ir);
}
}