KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > debug > internal > ui > DynamicInstructionPointerAnnotation


1 /*******************************************************************************
2  * Copyright (c) 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.debug.internal.ui;
12
13  
14 import org.eclipse.debug.core.model.IStackFrame;
15 import org.eclipse.jface.text.source.Annotation;
16
17 /**
18  * Client specified instruction pointer annotation.
19  */

20 public class DynamicInstructionPointerAnnotation extends Annotation {
21
22     /**
23      * The frame for this instruction pointer annotation. This is necessary only so that
24      * instances of this class can be distinguished by equals().
25      */

26     private IStackFrame fStackFrame;
27         
28     /**
29      *
30      * @param frame
31      * @param markerAnnotationSpecificationId
32      * @param text
33      */

34     public DynamicInstructionPointerAnnotation(IStackFrame frame, String JavaDoc markerAnnotationSpecificationId, String JavaDoc text) {
35         super(markerAnnotationSpecificationId, false, text);
36         fStackFrame = frame;
37     }
38     
39     /* (non-Javadoc)
40      * @see java.lang.Object#equals(java.lang.Object)
41      */

42     public boolean equals(Object JavaDoc other) {
43         if (other instanceof DynamicInstructionPointerAnnotation) {
44             return getStackFrame().equals(((DynamicInstructionPointerAnnotation)other).getStackFrame());
45         }
46         return false;
47     }
48     
49     /* (non-Javadoc)
50      * @see java.lang.Object#hashCode()
51      */

52     public int hashCode() {
53         return getStackFrame().hashCode();
54     }
55
56     /**
57      * Returns the stack frame associated with this annotation
58      *
59      * @return the stack frame associated with this annotation
60      */

61     private IStackFrame getStackFrame() {
62         return fStackFrame;
63     }
64
65 }
66
Popular Tags