1 /*******************************************************************************
2 * Copyright (c) 2016 École Polytechnique de Montréal
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
.tmf
.chart
.core
.descriptor
;
12 import org
.eclipse
.jdt
.annotation
.Nullable
;
13 import org
.eclipse
.tracecompass
.internal
.provisional
.tmf
.chart
.core
.resolver
.INumericalResolver
;
16 * Abstract class for describing numbers from a stream of objects it
20 * The type of the input it understands
22 * The type of the output number it describes
24 * @see IDataChartDescriptor
26 * @author Gabriel-Andrew Pollo-Guilbert
28 public class DataChartNumericalDescriptor
<T
, R
extends Number
> implements IDataChartDescriptor
<T
, R
> {
30 // ------------------------------------------------------------------------
32 // ------------------------------------------------------------------------
34 private final String fName
;
35 private final INumericalResolver
<T
, R
> fResolver
;
37 // ------------------------------------------------------------------------
39 // ------------------------------------------------------------------------
45 * The name of the descriptor
47 * The resolver used for mapping numbers
49 public DataChartNumericalDescriptor(String name
, INumericalResolver
<T
, R
> resolver
) {
54 // ------------------------------------------------------------------------
56 // ------------------------------------------------------------------------
59 public void accept(IDescriptorVisitor visitor
) {
64 public INumericalResolver
<T
, R
> getResolver() {
69 public String
getName() {
74 public @Nullable String
getUnit() {
79 public String
toString() {
80 return "Numerical Descriptor: " + getName(); //$NON-NLS-1$