1 /*******************************************************************************
2 * Copyright (c) 2009, 2014 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 * Francois Chouinard - Initial API and implementation
11 * Francois Chouinard - Updated as per TMF Trace Model 1.0
12 *******************************************************************************/
14 package org
.eclipse
.tracecompass
.tmf
.core
.trace
.location
;
18 * A abstract implementation of ITmfLocation. The concrete classes must provide
19 * comparable location information.
21 * @author Francois Chouinard
23 public abstract class TmfLocation
implements ITmfLocation
{
25 // ------------------------------------------------------------------------
27 // ------------------------------------------------------------------------
29 private final Comparable
<?
> fLocationInfo
;
31 // ------------------------------------------------------------------------
33 // ------------------------------------------------------------------------
36 * Standard constructor.
39 * The concrete trace location
41 public TmfLocation(final Comparable
<?
> locationInfo
) {
42 fLocationInfo
= locationInfo
;
49 * The original trace location
51 public TmfLocation(final TmfLocation location
) {
52 fLocationInfo
= location
.fLocationInfo
;
55 // ------------------------------------------------------------------------
57 // ------------------------------------------------------------------------
60 public Comparable
<?
> getLocationInfo() {
64 // ------------------------------------------------------------------------
66 // ------------------------------------------------------------------------
69 public int hashCode() {
72 result
= prime
* result
+ ((fLocationInfo
!= null) ? fLocationInfo
.hashCode() : 0);
77 public boolean equals(final Object obj
) {
84 if (getClass() != obj
.getClass()) {
87 final TmfLocation other
= (TmfLocation
) obj
;
88 if (fLocationInfo
== null) {
89 if (other
.fLocationInfo
!= null) {
92 } else if (!fLocationInfo
.equals(other
.fLocationInfo
)) {
99 @SuppressWarnings("nls")
100 public String
toString() {
101 return getClass().getSimpleName() + " [fLocationInfo=" + fLocationInfo
+ "]";
This page took 0.031729 seconds and 5 git commands to generate.