069b8f7b5e9c07b7a4fa00bbf7d5583fa3bf04d0
1 /*******************************************************************************
2 * Copyright (c) 2016 EfficiOS Inc., Michael Jeanson
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
8 *******************************************************************************/
10 package org
.eclipse
.tracecompass
.internal
.provisional
.analysis
.lami
.core
.aspect
;
12 import java
.util
.Comparator
;
14 import org
.eclipse
.jdt
.annotation
.NonNull
;
15 import org
.eclipse
.jdt
.annotation
.Nullable
;
16 import org
.eclipse
.tracecompass
.internal
.provisional
.analysis
.lami
.core
.module
.LamiTableEntry
;
17 import org
.eclipse
.tracecompass
.internal
.provisional
.analysis
.lami
.core
.types
.LamiData
;
18 import org
.eclipse
.tracecompass
.internal
.provisional
.analysis
.lami
.core
.types
.LamiDuration
;
21 * Aspect for a time range duration
23 * @author Michael Jeanson
25 public class LamiDurationAspect
extends LamiTableEntryAspect
{
27 private final int fColIndex
;
37 public LamiDurationAspect(String colName
, int colIndex
) {
38 super(colName
, "ns"); //$NON-NLS-1$
43 public boolean isContinuous() {
48 public boolean isTimeStamp() {
53 public boolean isTimeDuration() {
58 public @Nullable String
resolveString(LamiTableEntry entry
) {
59 LamiData data
= entry
.getValue(fColIndex
);
60 if (data
instanceof LamiDuration
) {
61 LamiDuration duration
= (LamiDuration
) data
;
62 return String
.valueOf(duration
.getValue());
64 return data
.toString();
68 public @Nullable Double
resolveDouble(@NonNull LamiTableEntry entry
) {
69 LamiData data
= entry
.getValue(fColIndex
);
70 if (data
instanceof LamiDuration
) {
71 LamiDuration range
= (LamiDuration
) data
;
72 return Double
.valueOf(range
.getValue());
78 public @NonNull Comparator
<@NonNull LamiTableEntry
> getComparator() {
80 Double dO1
= resolveDouble(o1
);
81 Double dO2
= resolveDouble(o2
);
82 if (dO1
== null || dO2
== null) {
86 return dO1
.compareTo(dO2
);
This page took 0.033835 seconds and 4 git commands to generate.