|
1 /* |
|
2 * Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 * Location rule for a function return trace |
|
17 * |
|
18 */ |
|
19 package com.nokia.tracebuilder.engine.rules; |
|
20 |
|
21 import com.nokia.tracebuilder.engine.source.SourceLocationRule; |
|
22 import com.nokia.tracebuilder.source.SourceReturn; |
|
23 |
|
24 /** |
|
25 * Location rule for a function return trace |
|
26 * |
|
27 */ |
|
28 public final class FunctionReturnLocationRule extends RuleBase implements |
|
29 SourceLocationRule { |
|
30 |
|
31 /** |
|
32 * Properties of the return statement to be traced |
|
33 */ |
|
34 private SourceReturn returnProperties; |
|
35 |
|
36 /** |
|
37 * Constructor |
|
38 * |
|
39 * @param returnProperties |
|
40 * the properties of the return statement |
|
41 */ |
|
42 public FunctionReturnLocationRule(SourceReturn returnProperties) { |
|
43 this.returnProperties = returnProperties; |
|
44 } |
|
45 |
|
46 /* |
|
47 * (non-Javadoc) |
|
48 * |
|
49 * @see com.nokia.tracebuilder.engine.source.SourceLocationRule#getLocationOffset() |
|
50 */ |
|
51 public int getLocationOffset() { |
|
52 return returnProperties.getOffset(); |
|
53 } |
|
54 |
|
55 /* |
|
56 * (non-Javadoc) |
|
57 * |
|
58 * @see com.nokia.tracebuilder.engine.source.SourceLocationRule#getLocationType() |
|
59 */ |
|
60 public int getLocationType() { |
|
61 // This inserts into absolute location |
|
62 return ABSOLUTE; |
|
63 } |
|
64 |
|
65 /* |
|
66 * (non-Javadoc) |
|
67 * |
|
68 * @see com.nokia.tracebuilder.engine.source.SourceLocationRule#isRemovedAfterInsert() |
|
69 */ |
|
70 public boolean isRemovedAfterInsert() { |
|
71 return true; |
|
72 } |
|
73 |
|
74 } |