1 /*******************************************************************************
2 * Copyright (c) 2009, 2010, 2012 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
.linuxtools
.tmf
.core
.trace
;
18 * A abstract implementation of ITmfLocation. The concrete classes must provide
19 * comparable location information.
22 * @author Francois Chouinard
24 public abstract class TmfLocation
implements ITmfLocation
{
26 // ------------------------------------------------------------------------
28 // ------------------------------------------------------------------------
30 private final Comparable
<?
> fLocationInfo
;
32 // ------------------------------------------------------------------------
34 // ------------------------------------------------------------------------
37 * Standard constructor.
40 * The concrete trace location
42 public TmfLocation(final Comparable
<?
> locationInfo
) {
43 fLocationInfo
= locationInfo
;
50 * The original trace location
52 public TmfLocation(final TmfLocation location
) {
53 fLocationInfo
= location
.fLocationInfo
;
56 // ------------------------------------------------------------------------
58 // ------------------------------------------------------------------------
64 public Comparable
<?
> getLocationInfo() {
68 // ------------------------------------------------------------------------
70 // ------------------------------------------------------------------------
73 public int hashCode() {
76 result
= prime
* result
+ ((fLocationInfo
!= null) ? fLocationInfo
.hashCode() : 0);
81 public boolean equals(final Object obj
) {
88 if (getClass() != obj
.getClass()) {
91 final TmfLocation other
= (TmfLocation
) obj
;
92 if (fLocationInfo
== null) {
93 if (other
.fLocationInfo
!= null) {
96 } else if (!fLocationInfo
.equals(other
.fLocationInfo
)) {
103 @SuppressWarnings("nls")
104 public String
toString() {
105 return getClass().getSimpleName() + " [fLocationInfo=" + fLocationInfo
.toString() + "]";
This page took 0.034555 seconds and 5 git commands to generate.