KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ltk > internal > ui > refactoring > history > RefactoringHistoryEntry


1 /*******************************************************************************
2  * Copyright (c) 2005, 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.ltk.internal.ui.refactoring.history;
12
13 import org.eclipse.ltk.core.refactoring.RefactoringDescriptorProxy;
14
15 /**
16  * Refactoring entry of a refactoring history.
17  *
18  * @since 3.2
19  */

20 public final class RefactoringHistoryEntry extends RefactoringHistoryNode {
21
22     /** The refactoring descriptor proxy */
23     private final RefactoringDescriptorProxy fDescriptorProxy;
24
25     /** The parent node, or <code>null</code> */
26     private final RefactoringHistoryNode fParent;
27
28     /**
29      * Creates a new refactoring history entry.
30      *
31      * @param parent
32      * the parent node, or <code>null</code>
33      * @param proxy
34      * the refactoring descriptor proxy
35      */

36     public RefactoringHistoryEntry(final RefactoringHistoryNode parent, final RefactoringDescriptorProxy proxy) {
37         fParent= parent;
38         fDescriptorProxy= proxy;
39     }
40
41     /**
42      * {@inheritDoc}
43      */

44     public boolean equals(final Object JavaDoc object) {
45         if (object instanceof RefactoringHistoryEntry) {
46             final RefactoringHistoryEntry entry= (RefactoringHistoryEntry) object;
47             return getDescriptor().equals(entry.getDescriptor());
48         }
49         return false;
50     }
51
52     /**
53      * Returns the refactoring descriptor.
54      *
55      * @return the refactoring descriptor
56      */

57     public RefactoringDescriptorProxy getDescriptor() {
58         return fDescriptorProxy;
59     }
60
61     /**
62      * {@inheritDoc}
63      */

64     public int getKind() {
65         return RefactoringHistoryNode.ENTRY;
66     }
67
68     /**
69      * {@inheritDoc}
70      */

71     public RefactoringHistoryNode getParent() {
72         return fParent;
73     }
74
75     /**
76      * {@inheritDoc}
77      */

78     public int hashCode() {
79         return getDescriptor().hashCode();
80     }
81 }
82
Popular Tags