sysperfana/analyzetoolext/com.nokia.s60tools.analyzetool/src/com/nokia/s60tools/analyzetool/engine/CallstackItem.java
changeset 1 1050670c6980
child 6 f65f740e69f9
equal deleted inserted replaced
0:5ad7ad99af01 1:1050670c6980
       
     1 /*
       
     2  * Copyright (c) 2008-2009 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:  Definitions for the class CallstackItem
       
    15  *
       
    16  */
       
    17 
       
    18 package com.nokia.s60tools.analyzetool.engine;
       
    19 
       
    20 /**
       
    21  * Contains information of one memory leak item Information is parsed from
       
    22  * atool.exe generated XML file so we can assume that all the information is
       
    23  * valid and no other checking is needed.
       
    24  *
       
    25  * @author kihe
       
    26  *
       
    27  */
       
    28 public class CallstackItem extends BaseItem {
       
    29 
       
    30 	/** File name. */
       
    31 	private String fileName;
       
    32 
       
    33 	/** Function name. */
       
    34 	private String functionName;
       
    35 
       
    36 	/** Memory leak line number. */
       
    37 	private int leakLineNumber;
       
    38 
       
    39 	/** Flag to inform that is results created for urel builds. */
       
    40 	private boolean urelBuild = false;
       
    41 
       
    42 
       
    43 	/**
       
    44 	 * Gets file name.
       
    45 	 *
       
    46 	 * @return File name
       
    47 	 */
       
    48 	public final String getFileName() {
       
    49 		return this.fileName;
       
    50 	}
       
    51 
       
    52 	/**
       
    53 	 * Gets function name.
       
    54 	 *
       
    55 	 * @return Function name
       
    56 	 */
       
    57 	public final String getFunctionName() {
       
    58 		return this.functionName;
       
    59 	}
       
    60 
       
    61 	/**
       
    62 	 * Gets leak line number.
       
    63 	 *
       
    64 	 * @return Leak line number
       
    65 	 */
       
    66 	public final int getLeakLineNumber() {
       
    67 		return this.leakLineNumber;
       
    68 	}
       
    69 
       
    70 	/**
       
    71 	 * Is results created for the urel build.
       
    72 	 *
       
    73 	 * @return True if results are created for the urel build otherwise false
       
    74 	 */
       
    75 	public final boolean isUrelBuild() {
       
    76 		return urelBuild;
       
    77 	}
       
    78 
       
    79 	/**
       
    80 	 * Sets cpp file name which contains memory leaks.
       
    81 	 *
       
    82 	 * @param newFileName
       
    83 	 *            File name
       
    84 	 */
       
    85 	public final void setFileName(final String newFileName) {
       
    86 		this.fileName = newFileName;
       
    87 	}
       
    88 
       
    89 	/**
       
    90 	 * Sets function name.
       
    91 	 *
       
    92 	 * @param newFunctionName
       
    93 	 *            Function name
       
    94 	 */
       
    95 	public final void setFunctionName(final String newFunctionName) {
       
    96 		this.functionName = newFunctionName;
       
    97 	}
       
    98 
       
    99 	/**
       
   100 	 * Sets leak line number.
       
   101 	 *
       
   102 	 * @param newLeakLineNumber
       
   103 	 *            Leak line number
       
   104 	 */
       
   105 	public final void setLeakLineNumber(final int newLeakLineNumber) {
       
   106 		this.leakLineNumber = newLeakLineNumber;
       
   107 	}
       
   108 
       
   109 	/**
       
   110 	 * Sets urel build flag.
       
   111 	 *
       
   112 	 * @param build
       
   113 	 *            Is project built with urel command
       
   114 	 */
       
   115 	public final void setUrelBuild(final boolean build) {
       
   116 		urelBuild = build;
       
   117 	}
       
   118 
       
   119 	/**
       
   120 	 * Checks that at least one needed information is available
       
   121 	 *
       
   122 	 * @return False if at least one needed information is available(not empty) otherwise
       
   123 	 *         True
       
   124 	 */
       
   125 	public boolean isEmpty() {
       
   126 		if ( !checkData() && (fileName == null || ("").equals(fileName))
       
   127 				&& (functionName == null || ("").equals(functionName) ) ) {
       
   128 			return true;
       
   129 		}
       
   130 		return false;
       
   131 	}
       
   132 }