ust: Add trace constructor with event factory
[deliverable/tracecompass.git] / statesystem / org.eclipse.tracecompass.datastore.core / src / org / eclipse / tracecompass / internal / provisional / datastore / core / interval / IHTInterval.java
1 /*******************************************************************************
2 * Copyright (c) 2017 École Polytechnique de Montréal
3 *
4 * All rights reserved. This program and the accompanying materials
5 * are made available under the terms of the Eclipse Public License v1.0
6 * which accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
8 *******************************************************************************/
9
10 package org.eclipse.tracecompass.internal.provisional.datastore.core.interval;
11
12 /**
13 * Generic interface for any serializable object (like a time range) that can be used in the
14 * generic history tree.
15 *
16 * @author Alexandre Montplaisir
17 * @author Geneviève Bastien
18 */
19 public interface IHTInterval extends ISerializableObject {
20
21 /**
22 * The start position/time of the object.
23 *
24 * @return The start position
25 */
26 long getStart();
27
28 /**
29 * The end position/time of the object
30 *
31 * @return The end position
32 */
33 long getEnd();
34
35 /**
36 * Utility method to check if the current interval intersects a timestamp.
37 *
38 * @param timestamp
39 * The timestamp to check
40 * @return If it intersects or not
41 */
42 default boolean intersects(long timestamp) {
43 if (getStart() <= timestamp && timestamp <= getEnd()) {
44 return true;
45 }
46 return false;
47 }
48
49 }
This page took 0.031454 seconds and 5 git commands to generate.