1 /*******************************************************************************
2 * Copyright (c) 2009 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 *******************************************************************************/
13 package org
.eclipse
.linuxtools
.tmf
.core
.event
;
16 * <b><u>TmfEventReference</u></b>
18 * An application-defined event reference.
20 public class TmfEventReference
implements Cloneable
{
22 // ------------------------------------------------------------------------
24 // ------------------------------------------------------------------------
26 protected Object fReference
;
28 // ------------------------------------------------------------------------
30 // ------------------------------------------------------------------------
33 * The default constructor
35 public TmfEventReference() {
40 * @param reference the event reference
42 public TmfEventReference(Object reference
) {
43 fReference
= reference
;
48 * @param other the original event reference
50 public TmfEventReference(TmfEventReference other
) {
52 throw new IllegalArgumentException();
53 TmfEventReference o
= (TmfEventReference
) other
;
54 fReference
= o
.fReference
;
57 // ------------------------------------------------------------------------
59 // ------------------------------------------------------------------------
62 * @return the event reference
64 public Object
getReference() {
68 // ------------------------------------------------------------------------
70 // ------------------------------------------------------------------------
73 public int hashCode() {
74 return (fReference
!= null) ? fReference
.hashCode() : 0;
78 @SuppressWarnings("nls")
79 public String
toString() {
80 return "[TmfEventReference(" + ((fReference
!= null) ? fReference
.toString() : "null") + ")]";
84 public boolean equals(Object other
) {
85 if (!(other
instanceof TmfEventReference
))
87 TmfEventReference o
= (TmfEventReference
) other
;
88 return fReference
.equals(o
.fReference
);
92 public TmfEventReference
clone() {
93 TmfEventReference clone
= null;
95 clone
= (TmfEventReference
) super.clone();
96 clone
.fReference
= fReference
;
98 catch (CloneNotSupportedException e
) {