tmf: Update Javadoc throughout tmf.ui
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.ui / src / org / eclipse / linuxtools / tmf / ui / views / uml2sd / util / TimeEventComparator.java
1 /**********************************************************************
2 * Copyright (c) 2005, 2006 IBM Corporation and others.
3 * Copyright (c) 2011, 2012 Ericsson.
4 *
5 * All rights reserved. This program and the accompanying materials
6 * are made available under the terms of the Eclipse Public License v1.0
7 * which accompanies this distribution, and is available at
8 * http://www.eclipse.org/legal/epl-v10.html
9 *
10 * Contributors:
11 * IBM - Initial API and implementation
12 * Bernd Hufmann - Updated for TMF
13 **********************************************************************/
14 package org.eclipse.linuxtools.tmf.ui.views.uml2sd.util;
15
16 import java.io.Serializable;
17 import java.util.Comparator;
18
19 import org.eclipse.linuxtools.tmf.ui.views.uml2sd.core.SDTimeEvent;
20
21 /**
22 * Time event comparator
23 *
24 * @version 1.0
25 * @author sveyrier
26 */
27 public class TimeEventComparator implements Comparator<SDTimeEvent>, Serializable {
28
29 // ------------------------------------------------------------------------
30 // Constants
31 // ------------------------------------------------------------------------
32
33 /**
34 * Serial version UID
35 */
36 private static final long serialVersionUID = 5885497718872575669L;
37
38 // ------------------------------------------------------------------------
39 // Methods
40 // ------------------------------------------------------------------------
41
42 /*
43 * (non-Javadoc)
44 * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
45 */
46 @Override
47 public int compare(SDTimeEvent arg0, SDTimeEvent arg1) {
48 SDTimeEvent t1 = (SDTimeEvent) arg0;
49 SDTimeEvent t2 = (SDTimeEvent) arg1;
50 if (t1.getEvent() > t2.getEvent()) {
51 return 1;
52 }
53 else if (t1.getEvent() == t2.getEvent()) {
54 return 0;
55 }
56 return -1;
57 }
58 }
This page took 0.030707 seconds and 5 git commands to generate.