aboutsummaryrefslogtreecommitdiffstats
blob: 6e9ed5df85b00319ce0e1d49ba46846a31d274d9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
/*******************************************************************************
 * Copyright (c) 2008, 2009 Red Hat, Inc.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *    Kent Sebastian <ksebasti@redhat.com> - initial API and implementation 
 *******************************************************************************/ 

package org.eclipse.linuxtools.internal.oprofile.core.model;

/**
 * This class represents a debugging symbol, the symbol output
 *  from opxml. If a symbol exists, it must have samples (which are
 *  OpModelSamples), although those samples may or may not have 
 *  complete debug info.
 */
public class OpModelSymbol {
	private String _name;
	private String _file;
	private int _line;
	private int _count;
	private OpModelSample[] _samples;
	private String _printTabs = ""; 	//for nice output //$NON-NLS-1$
	
	public OpModelSymbol() {
		_name = ""; //$NON-NLS-1$
		_file = ""; //$NON-NLS-1$
		_count = 0;
		_samples = null;
	}
	
	public void _setName(String _name) {
		this._name = _name;
	}

	public void _setFilePath(String _file) {
		this._file = _file;
	}

	public void setLine(int _line){
		this._line = _line;
	}

	public void _setCount(int _count) {
		this._count = _count;
	}

	public void _setSamples(OpModelSample[] _samples) {
		this._samples = _samples;
	}

	public String getName() {
		return _name;
	}

	public String getFilePath() {
		return _file;
	}

	public int getLine(){
		return _line;
	}

	public int getCount() {
		return _count;
	}

	public OpModelSample[] getSamples() {
		return _samples;
	}

	public String toString(String tabs) {
		_printTabs = tabs;
		String s = toString();
		_printTabs = ""; //$NON-NLS-1$
		return s;
	}

	@Override
	public String toString() {
		String s = _name + ", File: " + _file + ", Count: " + _count + "\n"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
		if (_samples != null) {
			for (int i = 0; i < _samples.length; i++) {
				s += _printTabs + "Sample: "; //$NON-NLS-1$
				s += _samples[i].toString();
			}
		}
		return s;
	}
}