1 /*******************************************************************************
2 * Copyright (c) 2012 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
.linuxtools
.tmf
.core
.interval
;
15 import org
.eclipse
.linuxtools
.tmf
.core
.statevalue
.ITmfStateValue
;
18 * The StateInterval represents the "state" a particular attribute was in, at a
19 * given time. It is the main object being returned from queries to the state
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 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
,
50 this.attribute
= attribute
;
55 public long getStartTime() {
60 public long getEndTime() {
65 public long getViewerEndTime() {
70 public int getAttribute() {
75 public ITmfStateValue
getStateValue() {
80 public boolean intersects(long timestamp
) {
81 if (start
<= timestamp
) {
82 if (end
>= timestamp
) {
90 public String
toString() {
91 /* Only used for debugging */
92 StringBuffer buf
= new StringBuffer(start
+ " to "); //$NON-NLS-1$
93 buf
.append(end
+ ' ');
94 buf
.append(String
.format("key = %4d, ", attribute
)); //$NON-NLS-1$
95 buf
.append("value = " + sv
.toString()); //$NON-NLS-1$
96 return buf
.toString();
This page took 0.033569 seconds and 5 git commands to generate.