Work on TmfCheckpoint
[deliverable/tracecompass.git] / org.eclipse.linuxtools.ctf.core / src / org / eclipse / linuxtools / ctf / core / trace / StreamInputReaderComparator.java
CommitLineData
866e5b51
FC
1/*******************************************************************************
2 * Copyright (c) 2011-2012 Ericsson, Ecole Polytechnique de Montreal and others
3 *
4 * All rights reserved. This program and the accompanying materials are made
5 * 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 *
9 * Contributors: Matthew Khouzam - Initial API and implementation
10 * Contributors: Simon Marchi - Initial API and implementation
11 *******************************************************************************/
12
13package org.eclipse.linuxtools.ctf.core.trace;
14
15import java.io.Serializable;
16import java.util.Comparator;
17
18/**
19 * <b><u>StreamInputReaderComparator</u></b>
20 * <p>
21 * TODO Implement me. Please.
22 */
23public class StreamInputReaderComparator implements
24 Comparator<StreamInputReader>, Serializable {
25
26 // ------------------------------------------------------------------------
27 // Constants
28 // ------------------------------------------------------------------------
29
30 private static final long serialVersionUID = 7477206132343139753L;
31
32 // ------------------------------------------------------------------------
33 // Operations
34 // ------------------------------------------------------------------------
35
36 @Override
37 public int compare(StreamInputReader a, StreamInputReader b) {
38 // TODO: use unsigned comparison to avoid sign errors if needed
39 long ta = a.getCurrentEvent().timestamp;
40 long tb = b.getCurrentEvent().timestamp;
41
42 if (ta < tb) {
43 return -1;
44 } else if (ta > tb) {
45 return 1;
46 } else {
47 return 0;
48 }
49 }
50
51}
This page took 0.026752 seconds and 5 git commands to generate.