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 * CtfLocationData, the data in a CTF location.
16 * @author Matthew Khouzam
19 public class CtfLocationData
implements Comparable
<CtfLocationData
> {
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 CtfLocationData(long ts
, long index
) {
37 * @return The timestamp
39 public long getTimestamp() {
44 * @return The index of the element
46 public long getIndex() {
53 * @see java.lang.Object#hashCode()
56 public int hashCode() {
59 result
= (prime
* result
) + (int) (index ^
(index
>>> 32));
60 result
= (prime
* result
) + (int) (timestamp ^
(timestamp
>>> 32));
67 * @see java.lang.Object#equals(java.lang.Object)
70 public boolean equals(Object obj
) {
77 if (!(obj
instanceof CtfLocationData
)) {
80 CtfLocationData other
= (CtfLocationData
) obj
;
81 if (index
!= other
.index
) {
84 if (timestamp
!= other
.timestamp
) {
93 * @see java.lang.Object#toString()
96 public String
toString() {
97 return "Element [" + timestamp
+ '/' + index
+ ']'; //$NON-NLS-1$
101 public int compareTo(CtfLocationData other
) {
102 if (this.timestamp
> other
.getTimestamp()) {
105 if (this.timestamp
< other
.getTimestamp()) {
108 if (this.index
> other
.getIndex()) {
111 if (this.index
< other
.getIndex()) {
This page took 0.033554 seconds and 5 git commands to generate.