07b745b31ded5b480b8672b97c4fb9dd5fdc4e45
1 /*******************************************************************************
2 * Copyright (c) 2016 EfficiOS Inc., Philippe Proulx
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
.Nullable
;
15 import org
.eclipse
.tracecompass
.internal
.provisional
.analysis
.lami
.core
.module
.LamiTableEntry
;
16 import org
.eclipse
.tracecompass
.internal
.provisional
.analysis
.lami
.core
.types
.LamiData
;
17 import org
.eclipse
.tracecompass
.internal
.provisional
.analysis
.lami
.core
.types
.LamiData
.DataType
;
20 * Aspect for LAMI mixed types.
22 * The data in this column can contain any class of data.
24 * @author Philippe Proulx
26 public class LamiMixedAspect
extends LamiTableEntryAspect
{
28 private final int fColIndex
;
38 public LamiMixedAspect(String colName
, int colIndex
) {
44 public boolean isContinuous() {
49 public boolean isTimeStamp() {
54 public @Nullable String
resolveString(LamiTableEntry entry
) {
55 LamiData data
= entry
.getValue(fColIndex
);
56 Class
<?
extends LamiData
> cls
= data
.getClass();
58 DataType dataType
= DataType
.fromClass(cls
);
60 if (dataType
== null) {
61 return data
.toString();
64 String str
= data
.toString();
66 if (dataType
.getUnits() != null) {
67 str
+= " " + dataType
.getUnits(); //$NON-NLS-1$
74 public @Nullable Double
resolveDouble(LamiTableEntry entry
) {
79 public Comparator
<LamiTableEntry
> getComparator() {
81 String s1
= resolveString(o1
);
82 String s2
= resolveString(o2
);
84 if (s1
== null || s2
== null) {
88 return s1
.compareTo(s2
);
This page took 0.035103 seconds and 4 git commands to generate.