sysperfana/analyzetoolext/com.nokia.s60tools.analyzetool/src/com/nokia/s60tools/analyzetool/engine/statistic/FreeInfo.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 FreeInfo
       
    15  *
       
    16  */
       
    17 package com.nokia.s60tools.analyzetool.engine.statistic;
       
    18 
       
    19 import java.util.Collection;
       
    20 import java.util.Collections;
       
    21 import java.util.HashSet;
       
    22 import java.util.Set;
       
    23 
       
    24 
       
    25 
       
    26 /**
       
    27  * Constains information of free
       
    28  * @author kihe
       
    29  *
       
    30  */
       
    31 public class FreeInfo extends BaseInfo {
       
    32 	Set<AllocInfo> allocsFreed;
       
    33 
       
    34 	/**
       
    35 	 * Adds an alloc which has been freed by this Free 
       
    36 	 * @param alloc the alloc to add
       
    37 	 */
       
    38 	public void addFreedAlloc(AllocInfo alloc){
       
    39 		if (allocsFreed == null){
       
    40 			allocsFreed = new HashSet<AllocInfo>();
       
    41 		}
       
    42 		allocsFreed.add(alloc);
       
    43 	}
       
    44 	
       
    45 	/**
       
    46 	 * Returns a collection of allocs freed by this Free
       
    47 	 * @return the Collection of AllocInfos freed
       
    48 	 */
       
    49 	public Collection<AllocInfo> getFreedAllocs(){
       
    50 		return Collections.unmodifiableSet(allocsFreed == null ? new HashSet<AllocInfo>() : allocsFreed);
       
    51 	}
       
    52 	
       
    53 }