~ubuntu-branches/ubuntu/wily/eclipse-linuxtools/wily

« back to all changes in this revision

Viewing changes to lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/ctf/core/event/CTFClock.java

  • Committer: Package Import Robot
  • Author(s): Jakub Adam, Jakub Adam, tony mancill
  • Date: 2014-10-11 11:44:05 UTC
  • mfrom: (1.2.4)
  • Revision ID: package-import@ubuntu.com-20141011114405-yazjvxfzzhmi5sgj
Tags: 3.1.0-1
[ Jakub Adam ]
* New upstream release (Closes: #761524).
* Refreshed d/patches.
* Don't build removed feature org.eclipse.linuxtools.tools.launch
  - merged into org.eclipse.linuxtools.profiling.
* Use javac target 1.7.
* Build new feature org.eclipse.linuxtools.dataviewers.feature
  - required by Valgrind integration.
* Build-depend on eclipse-remote-services-api and eclipse-cdt-autotools.
* Bump Standards-Version to 3.9.6.
* Override incompatible-java-bytecode-format - linuxtools needs Java 7.
* Remove unused codeless-jar override.

[ tony mancill ]
* Tweak short package description to make lintian happy.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*******************************************************************************
2
 
 * Copyright (c) 2011-2012 Ericsson, Ecole Polytechnique de Montreal and others
 
2
 * Copyright (c) 2011, 2014 Ericsson, Ecole Polytechnique de Montreal and others
3
3
 *
4
4
 * All rights reserved. This program and the accompanying materials are made
5
5
 * available under the terms of the Eclipse Public License v1.0 which
27
27
    private static final String FREQ = "freq"; //$NON-NLS-1$
28
28
    private static final String OFFSET = "offset"; //$NON-NLS-1$
29
29
 
30
 
    private long clockOffset = 0;
31
 
    private double clockScale = 1.0;
32
 
    private double clockAntiScale = 1.0;
 
30
    private long fClockOffset = 0;
 
31
    private double fClockScale = 1.0;
 
32
    private double fClockAntiScale = 1.0;
33
33
 
34
34
    /**
35
35
     * Field properties.
36
36
     */
37
 
    private final Map<String, Object> properties = new HashMap<String, Object>();
 
37
    private final Map<String, Object> fProperties = new HashMap<>();
38
38
    /**
39
39
     * Field name.
40
40
     */
41
 
    private String name;
42
 
    private boolean isScaled = false;
 
41
    private String fName;
 
42
    private boolean fIsScaled = false;
43
43
 
44
44
    /**
45
45
     * Default constructor
56
56
     *            Object
57
57
     */
58
58
    public void addAttribute(String key, Object value) {
59
 
        this.properties.put(key, value);
 
59
        fProperties.put(key, value);
60
60
        if (key.equals(NAME)) {
61
 
            this.name = (String) value;
 
61
            fName = (String) value;
62
62
        }
63
63
        if (key.equals(FREQ)) {
64
64
            /*
68
68
             * have a system with a frequency of > 1 600 000 000 GHz with
69
69
             * 200 ppm precision
70
70
             */
71
 
            isScaled = !((Long) getProperty(FREQ)).equals(ONE_BILLION_L);
72
 
            clockScale = ONE_BILLION_D / ((Long) getProperty(FREQ)).doubleValue();
73
 
            clockAntiScale = 1.0 / clockScale;
 
71
            fIsScaled = !((Long) getProperty(FREQ)).equals(ONE_BILLION_L);
 
72
            fClockScale = ONE_BILLION_D / ((Long) getProperty(FREQ)).doubleValue();
 
73
            fClockAntiScale = 1.0 / fClockScale;
74
74
 
75
75
        }
76
76
        if (key.equals(OFFSET)) {
77
 
            clockOffset = (Long) getProperty(OFFSET);
 
77
            fClockOffset = (Long) getProperty(OFFSET);
78
78
        }
79
79
    }
80
80
 
84
84
     * @return String
85
85
     */
86
86
    public String getName() {
87
 
        return name;
 
87
        return fName;
88
88
    }
89
89
 
90
90
    /**
95
95
     * @return Object
96
96
     */
97
97
    public Object getProperty(String key) {
98
 
        return properties.get(key);
 
98
        return fProperties.get(key);
99
99
    }
100
100
 
101
101
    /**
103
103
     * @since 2.0
104
104
     */
105
105
    public long getClockOffset() {
106
 
        return clockOffset;
 
106
        return fClockOffset;
107
107
    }
108
108
 
109
109
    /**
111
111
     * @since 2.0
112
112
     */
113
113
    public double getClockScale() {
114
 
        return clockScale;
 
114
        return fClockScale;
115
115
    }
116
116
 
117
117
    /**
119
119
     * @since 2.0
120
120
     */
121
121
    public double getClockAntiScale() {
122
 
        return clockAntiScale;
 
122
        return fClockAntiScale;
123
123
    }
124
124
 
125
125
    /**
127
127
     * @since 2.0
128
128
     */
129
129
    public boolean isClockScaled() {
130
 
        return isScaled;
 
130
        return fIsScaled;
131
131
    }
132
132
 
133
133
}