1 /*******************************************************************************
2 * Copyright (c) 2012 Ericsson
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
9 * Contributors: Matthew Khouzam - Initial API and implementation
10 *******************************************************************************/
11 package org
.eclipse
.linuxtools
.tmf
.core
.ctfadaptor
;
14 * The data object to go in a {@link CtfLocation}.
16 * @author Matthew Khouzam
19 public class CtfLocationInfo
implements Comparable
<CtfLocationInfo
> {
21 private final long timestamp
;
22 private final long index
;
28 * Index of this event (if there are N elements with the same
29 * timestamp, which one is it.)
31 public CtfLocationInfo(long ts
, long index
) {
37 * @return The timestamp
39 public long getTimestamp() {
44 * @return The index of the element
46 public long getIndex() {
50 // ------------------------------------------------------------------------
52 // ------------------------------------------------------------------------
55 public int hashCode() {
58 result
= (prime
* result
) + (int) (index ^
(index
>>> 32));
59 result
= (prime
* result
) + (int) (timestamp ^
(timestamp
>>> 32));
64 public boolean equals(Object obj
) {
71 if (!(obj
instanceof CtfLocationInfo
)) {
74 CtfLocationInfo other
= (CtfLocationInfo
) obj
;
75 if (index
!= other
.index
) {
78 if (timestamp
!= other
.timestamp
) {
85 public String
toString() {
86 return "Element [" + timestamp
+ '/' + index
+ ']'; //$NON-NLS-1$
89 // ------------------------------------------------------------------------
91 // ------------------------------------------------------------------------
94 public int compareTo(CtfLocationInfo other
) {
95 if (this.timestamp
> other
.getTimestamp()) {
98 if (this.timestamp
< other
.getTimestamp()) {
101 if (this.index
> other
.getIndex()) {
104 if (this.index
< other
.getIndex()) {
This page took 0.035107 seconds and 6 git commands to generate.