KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > pde > internal > core > SourceLocation


1 /*******************************************************************************
2  * Copyright (c) 2000, 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.pde.internal.core;
12
13 import org.eclipse.core.runtime.IPath;
14
15 public class SourceLocation {
16     private IPath path;
17     private boolean userDefined = true;
18
19     public SourceLocation(IPath path) {
20         this.path = path;
21     }
22
23     public IPath getPath() {
24         return path;
25     }
26     
27     public void setPath(IPath path) {
28         this.path = path;
29     }
30
31     public boolean isUserDefined() {
32         return userDefined;
33     }
34
35     public void setUserDefined(boolean userDefined) {
36         this.userDefined = userDefined;
37     }
38     
39     public String JavaDoc toString() {
40         return path.toOSString();
41     }
42     
43     public boolean equals(Object JavaDoc obj) {
44         if (obj instanceof SourceLocation) {
45             SourceLocation object = (SourceLocation)obj;
46             return object.getPath().equals(path);
47         }
48         return false;
49     }
50
51 }
52
Popular Tags