16 */ |
16 */ |
17 |
17 |
18 package com.nokia.carbide.cpp.internal.pi.model; |
18 package com.nokia.carbide.cpp.internal.pi.model; |
19 import java.io.Serializable; |
19 import java.io.Serializable; |
20 |
20 |
21 public class Function implements Serializable |
21 public class Function implements IFunction, Serializable |
22 { |
22 { |
23 private static final long serialVersionUID = -3261268206319782647L; |
23 private static final long serialVersionUID = -3261268206319782647L; |
24 |
24 |
25 public Binary functionBinary; |
25 private IBinary functionBinary; |
26 public Long startAddress; |
26 private Long startAddress; |
27 public long offsetFromBinaryStart; |
27 private long offsetFromBinaryStart; |
28 public long length; |
28 private long length; |
29 |
29 |
30 public String functionName; |
30 private String functionName; |
31 |
31 |
32 public Function(String functionName, Long functionStart, String functionBinary) |
32 public Function(String functionName, Long functionStart, String functionBinary) |
33 { |
33 { |
34 this.functionName = functionName; |
34 this.functionName = functionName; |
35 this.startAddress = functionStart; |
35 this.startAddress = functionStart; |
36 this.functionBinary = new Binary(functionBinary); |
36 this.functionBinary = new Binary(functionBinary); |
37 } |
37 } |
38 |
38 |
39 public String toString() |
39 /* (non-Javadoc) |
40 { |
40 * @see com.nokia.carbide.cpp.internal.pi.model.IFunction#getFunctionBinary() |
41 return this.functionName+" @"+Long.toHexString(this.startAddress.intValue()); //$NON-NLS-1$ |
41 */ |
42 } |
42 public IBinary getFunctionBinary() { |
|
43 return functionBinary; |
|
44 } |
|
45 |
|
46 /** |
|
47 * Setter for the binary this function is in |
|
48 * @param functionBinary the functionBinary to set |
|
49 */ |
|
50 public void setFunctionBinary(Binary functionBinary) { |
|
51 this.functionBinary = functionBinary; |
|
52 } |
|
53 |
|
54 /* (non-Javadoc) |
|
55 * @see com.nokia.carbide.cpp.internal.pi.model.IFunction#getStartAddress() |
|
56 */ |
|
57 public Long getStartAddress() { |
|
58 return startAddress; |
|
59 } |
|
60 |
|
61 /** |
|
62 * Setter for start address |
|
63 * @param startAddress the start address to set |
|
64 */ |
|
65 public void setStartAddress(Long startAddress) { |
|
66 this.startAddress = startAddress; |
|
67 } |
|
68 |
|
69 /* (non-Javadoc) |
|
70 * @see com.nokia.carbide.cpp.internal.pi.model.IFunction#getOffsetFromBinaryStart() |
|
71 */ |
|
72 public long getOffsetFromBinaryStart() { |
|
73 return offsetFromBinaryStart; |
|
74 } |
|
75 |
|
76 /* (non-Javadoc) |
|
77 * @see com.nokia.carbide.cpp.internal.pi.model.IFunction#getLength() |
|
78 */ |
|
79 public long getLength() { |
|
80 return length; |
|
81 } |
|
82 |
|
83 /* (non-Javadoc) |
|
84 * @see com.nokia.carbide.cpp.internal.pi.model.IFunction#getFunctionName() |
|
85 */ |
|
86 public String getFunctionName() { |
|
87 return functionName; |
|
88 } |
|
89 |
|
90 /** Setter for offset from binary start |
|
91 * @param offsetFromBinaryStart the offset to set |
|
92 */ |
|
93 public void setOffsetFromBinaryStart(long offsetFromBinaryStart) { |
|
94 this.offsetFromBinaryStart = offsetFromBinaryStart; |
|
95 } |
|
96 |
|
97 /** |
|
98 * Setter for the length |
|
99 * @param length the length to set |
|
100 */ |
|
101 public void setLength(long length) { |
|
102 this.length = length; |
|
103 } |
|
104 |
|
105 @Override |
|
106 public String toString() { |
|
107 return this.functionName |
|
108 + " @" + Long.toHexString(this.startAddress.intValue()); //$NON-NLS-1$ |
|
109 } |
43 |
110 |
44 } |
111 } |