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 * Default constructor (for the 'null' location)
39 @SuppressWarnings("unused")
40 private TmfLocation() {
45 * Standard constructor.
47 * @param locationInfo the concrete trace location
49 public TmfLocation(final Comparable
<?
> locationInfo
) {
50 fLocationInfo
= locationInfo
;
56 * @param location the original trace location
58 public TmfLocation(final TmfLocation location
) {
59 fLocationInfo
= location
.fLocationInfo
;
62 // ------------------------------------------------------------------------
64 // ------------------------------------------------------------------------
67 * @see org.eclipse.linuxtools.tmf.core.trace.ITmfLocation#getLocationInfo()
73 public Comparable
<?
> getLocationInfo() {
77 // ------------------------------------------------------------------------
79 // ------------------------------------------------------------------------
82 * @see java.lang.Object#hashCode()
85 public int hashCode() {
88 result
= prime
* result
+ ((fLocationInfo
!= null) ? fLocationInfo
.hashCode() : 0);
93 * @see java.lang.Object#equals(java.lang.Object)
96 public boolean equals(final Object obj
) {
103 if (getClass() != obj
.getClass()) {
106 final TmfLocation other
= (TmfLocation
) obj
;
107 if (fLocationInfo
== null) {
108 if (other
.fLocationInfo
!= null) {
111 } else if (!fLocationInfo
.equals(other
.fLocationInfo
)) {
118 @SuppressWarnings("nls")
119 public String
toString() {
120 return "TmfLocation [fLocation=" + fLocationInfo
+ "]";
This page took 0.032062 seconds and 5 git commands to generate.