b242fa5400f0fbfafc61763b93b19579cd6f944e
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
.LamiProcess
;
20 * Aspect for process PID
22 * @author Philippe Proulx
24 public class LamiProcessPIDAspect
extends LamiTableEntryAspect
{
26 private final int fColIndex
;
36 public LamiProcessPIDAspect(String colName
, int colIndex
) {
37 super(colName
+ " (PID)", null); //$NON-NLS-1$
42 public boolean isContinuous() {
47 public boolean isTimeStamp() {
52 public @Nullable String
resolveString(LamiTableEntry entry
) {
53 LamiData data
= entry
.getValue(fColIndex
);
54 if (data
instanceof LamiProcess
) {
55 Long pid
= ((LamiProcess
) data
).getPID();
61 return pid
.toString();
63 /* Could be null, unknown, etc. */
64 return data
.toString();
68 public @Nullable Double
resolveDouble(LamiTableEntry entry
) {
69 LamiData data
= entry
.getValue(fColIndex
);
70 if (data
instanceof LamiProcess
) {
71 Long pid
= ((LamiProcess
) data
).getPID();
77 return Double
.valueOf(pid
);
84 public Comparator
<LamiTableEntry
> getComparator() {
86 Double dO1
= resolveDouble(o1
);
87 Double dO2
= resolveDouble(o2
);
88 if (dO1
== null || dO2
== null) {
92 return dO1
.compareTo(dO2
);
This page took 0.0326 seconds and 5 git commands to generate.