~ubuntu-branches/ubuntu/trusty/eclipse-linuxtools/trusty

« back to all changes in this revision

Viewing changes to gcov/org.eclipse.linuxtools.gcov.core/src/org/eclipse/linuxtools/internal/gcov/view/annotatedsource/STAnnotatedSourceNotFoundEditorInput.java

  • Committer: Package Import Robot
  • Author(s): Jakub Adam
  • Date: 2012-06-29 12:07:30 UTC
  • Revision ID: package-import@ubuntu.com-20120629120730-bfri1xys1i71dpn6
Tags: upstream-1.0.0
ImportĀ upstreamĀ versionĀ 1.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*******************************************************************************
 
2
 * Copyright (c) 2009 STMicroelectronics.
 
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
 *    Xavier Raynaud <xavier.raynaud@st.com> - initial API and implementation
 
10
 *******************************************************************************/
 
11
package org.eclipse.linuxtools.internal.gcov.view.annotatedsource;
 
12
 
 
13
import org.eclipse.core.resources.IProject;
 
14
import org.eclipse.core.runtime.IPath;
 
15
import org.eclipse.linuxtools.binutils.link2source.STCSourceNotFoundEditorInput;
 
16
import org.eclipse.linuxtools.internal.gcov.parser.SourceFile;
 
17
 
 
18
 
 
19
public class STAnnotatedSourceNotFoundEditorInput extends STCSourceNotFoundEditorInput {
 
20
 
 
21
        private final SourceFile sourceFile;
 
22
        
 
23
        public STAnnotatedSourceNotFoundEditorInput(IProject project,
 
24
                        SourceFile sourceFile,
 
25
                        IPath sourcePath, int lineNumber) {
 
26
                super(project, sourcePath, lineNumber);
 
27
                this.sourceFile = sourceFile;
 
28
        }
 
29
 
 
30
        /**
 
31
         * @return the sourceFile
 
32
         */
 
33
        public SourceFile getSourceFile() {
 
34
                return sourceFile;
 
35
        }
 
36
 
 
37
        /* (non-Javadoc)
 
38
         * @see java.lang.Object#hashCode()
 
39
         */
 
40
        @Override
 
41
        public int hashCode() {
 
42
                final int prime = 31;
 
43
                int result = super.hashCode();
 
44
                result = prime * result
 
45
                                + ((sourceFile == null) ? 0 : sourceFile.hashCode());
 
46
                return result;
 
47
        }
 
48
 
 
49
        /* (non-Javadoc)
 
50
         * @see java.lang.Object#equals(java.lang.Object)
 
51
         */
 
52
        @Override
 
53
        public boolean equals(Object obj) {
 
54
                if (this == obj)
 
55
                        return true;
 
56
                if (!super.equals(obj))
 
57
                        return false;
 
58
                if (getClass() != obj.getClass())
 
59
                        return false;
 
60
                final STAnnotatedSourceNotFoundEditorInput other = (STAnnotatedSourceNotFoundEditorInput) obj;
 
61
                if (sourceFile == null) {
 
62
                        if (other.sourceFile != null)
 
63
                                return false;
 
64
                } else if (!sourceFile.equals(other.sourceFile))
 
65
                        return false;
 
66
                return true;
 
67
        }
 
68
 
 
69
}