KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > debug > core > model > LineBreakpoint


1 /*******************************************************************************
2  * Copyright (c) 2000, 2005 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.core.model;
12
13
14 import org.eclipse.core.resources.IMarker;
15 import org.eclipse.core.runtime.CoreException;
16
17
18 /**
19  * Abstract implementation of a line breakpoint. This class is
20  * intended to be subclassed by debug model specific implementations
21  * of line breakpoints.
22  *
23  * @see ILineBreakpoint
24  */

25
26 public abstract class LineBreakpoint extends Breakpoint implements ILineBreakpoint {
27     
28
29     /**
30      * @see ILineBreakpoint#getLineNumber()
31      */

32     public int getLineNumber() throws CoreException {
33         IMarker m = getMarker();
34         if (m != null) {
35             return m.getAttribute(IMarker.LINE_NUMBER, -1);
36         }
37         return -1;
38     }
39
40     /**
41      * @see ILineBreakpoint#getCharStart()
42      */

43     public int getCharStart() throws CoreException {
44         IMarker m = getMarker();
45         if (m != null) {
46             return m.getAttribute(IMarker.CHAR_START, -1);
47         }
48         return -1;
49     }
50
51     /**
52      * @see ILineBreakpoint#getCharEnd()
53      */

54     public int getCharEnd() throws CoreException {
55         IMarker m = getMarker();
56         if (m != null) {
57             return m.getAttribute(IMarker.CHAR_END, -1);
58         }
59         return -1;
60     }
61 }
62
63
Popular Tags