1 /**********************************************************************
2 * Copyright (c) 2013 Ericsson
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
10 * Bernd Hufmann - Initial API and implementation
11 **********************************************************************/
12 package org
.eclipse
.linuxtools
.internal
.lttng2
.control
.ui
.views
.service
;
14 import org
.osgi
.framework
.Version
;
17 * A version implementation with a special compareTo implementation
18 * to bypass problems of older implementation of org.osgi.framework.Version.
20 * @author Bernd Hufmann
22 public class LttngVersion
extends Version
{
30 public LttngVersion(String version
) {
35 * Special compareTo method to fix problem of older implementations of org.osgi.framework.Version
36 * where {@code Version.compareTo} takes an {@code Object} instead a {@code Version} as argument.
39 * - Other version to compare
40 * @return a negative integer, zero, or a positive integer if this version
41 * is less than, equal to, or greater than the specified
42 * {@code LttngVersion} object.
44 public int compareTo(LttngVersion other
) {
45 if (other
== this) { // quicktest
49 int result
= getMajor() - other
.getMajor();
54 result
= getMinor() - other
.getMinor();
59 result
= getMicro() - other
.getMicro();
63 return getQualifier().compareTo(other
.getQualifier());
This page took 0.047024 seconds and 5 git commands to generate.