1 /*******************************************************************************
2 * Copyright (c) 2012, 2014 Ericsson
3 * Copyright (c) 2010, 2011 École Polytechnique de Montréal
4 * Copyright (c) 2010, 2011 Alexandre Montplaisir <alexandre.montplaisir@gmail.com>
6 * All rights reserved. This program and the accompanying materials are
7 * made available under the terms of the Eclipse Public License v1.0 which
8 * accompanies this distribution, and is available at
9 * http://www.eclipse.org/legal/epl-v10.html
11 *******************************************************************************/
13 package org
.eclipse
.tracecompass
.statesystem
.core
.interval
;
15 import org
.eclipse
.jdt
.annotation
.NonNull
;
16 import org
.eclipse
.tracecompass
.statesystem
.core
.statevalue
.ITmfStateValue
;
18 import com
.google
.common
.base
.Objects
;
21 * The StateInterval represents the "state" a particular attribute was in, at a
22 * given time. It is the main object being returned from queries to the state
25 * @author Alexandre Montplaisir
27 public final class TmfStateInterval
implements ITmfStateInterval
{
29 private final long start
;
30 private final long end
;
31 private final int attribute
;
32 private final @NonNull ITmfStateValue sv
;
35 * Construct an interval from its given parameters
42 * Attribute linked to this interval
44 * State value this interval will contain
46 public TmfStateInterval(long start
, long end
, int attribute
,
47 @NonNull ITmfStateValue sv
) {
50 this.attribute
= attribute
;
55 public long getStartTime() {
60 public long getEndTime() {
65 public int getAttribute() {
70 public ITmfStateValue
getStateValue() {
75 public boolean intersects(long timestamp
) {
76 if (start
<= timestamp
) {
77 if (end
>= timestamp
) {
85 public String
toString() {
86 /* Only used for debugging */
87 return Objects
.toStringHelper(this)
88 .add("start", start
) //$NON-NLS-1$
89 .add("end", end
) //$NON-NLS-1$
90 .add("key", attribute
) //$NON-NLS-1$
91 .add("value", sv
.toString()) //$NON-NLS-1$
This page took 0.036067 seconds and 5 git commands to generate.