diff -r 615035072f7e -r 844b047e260d sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi/src/com/nokia/carbide/cpp/internal/pi/model/Function.java --- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi/src/com/nokia/carbide/cpp/internal/pi/model/Function.java Tue Apr 20 14:41:43 2010 +0300 +++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi/src/com/nokia/carbide/cpp/internal/pi/model/Function.java Wed Apr 21 15:14:16 2010 +0300 @@ -18,16 +18,16 @@ package com.nokia.carbide.cpp.internal.pi.model; import java.io.Serializable; -public class Function implements Serializable +public class Function implements IFunction, Serializable { private static final long serialVersionUID = -3261268206319782647L; - public Binary functionBinary; - public Long startAddress; - public long offsetFromBinaryStart; - public long length; + private IBinary functionBinary; + private Long startAddress; + private long offsetFromBinaryStart; + private long length; - public String functionName; + private String functionName; public Function(String functionName, Long functionStart, String functionBinary) { @@ -35,10 +35,77 @@ this.startAddress = functionStart; this.functionBinary = new Binary(functionBinary); } - - public String toString() - { - return this.functionName+" @"+Long.toHexString(this.startAddress.intValue()); //$NON-NLS-1$ - } + + /* (non-Javadoc) + * @see com.nokia.carbide.cpp.internal.pi.model.IFunction#getFunctionBinary() + */ + public IBinary getFunctionBinary() { + return functionBinary; + } + + /** + * Setter for the binary this function is in + * @param functionBinary the functionBinary to set + */ + public void setFunctionBinary(Binary functionBinary) { + this.functionBinary = functionBinary; + } + + /* (non-Javadoc) + * @see com.nokia.carbide.cpp.internal.pi.model.IFunction#getStartAddress() + */ + public Long getStartAddress() { + return startAddress; + } + + /** + * Setter for start address + * @param startAddress the start address to set + */ + public void setStartAddress(Long startAddress) { + this.startAddress = startAddress; + } + + /* (non-Javadoc) + * @see com.nokia.carbide.cpp.internal.pi.model.IFunction#getOffsetFromBinaryStart() + */ + public long getOffsetFromBinaryStart() { + return offsetFromBinaryStart; + } + + /* (non-Javadoc) + * @see com.nokia.carbide.cpp.internal.pi.model.IFunction#getLength() + */ + public long getLength() { + return length; + } + + /* (non-Javadoc) + * @see com.nokia.carbide.cpp.internal.pi.model.IFunction#getFunctionName() + */ + public String getFunctionName() { + return functionName; + } + + /** Setter for offset from binary start + * @param offsetFromBinaryStart the offset to set + */ + public void setOffsetFromBinaryStart(long offsetFromBinaryStart) { + this.offsetFromBinaryStart = offsetFromBinaryStart; + } + + /** + * Setter for the length + * @param length the length to set + */ + public void setLength(long length) { + this.length = length; + } + + @Override + public String toString() { + return this.functionName + + " @" + Long.toHexString(this.startAddress.intValue()); //$NON-NLS-1$ + } }