1
/*******************************************************************************
2
* Copyright (c) 2004, 2008, 2009 Red Hat, Inc.
3
* All rights reserved. This program and the accompanying materials
4
* are made available under the terms of the Eclipse Public License v1.0
5
* which accompanies this distribution, and is available at
6
* http://www.eclipse.org/legal/epl-v10.html
9
* Keith Seitz <keiths@redhat.com> - initial API and implementation
10
* Kent Sebastian <ksebasti@redhat.com> -
11
*******************************************************************************/
13
package org.eclipse.linuxtools.internal.oprofile.core.model;
16
* A class which represents the event collected in a given session.
18
public class OpModelEvent {
19
private String eventName;
20
private OpModelSession[] sessions;
21
private String printTabs = ""; //for nice output //$NON-NLS-1$
23
public OpModelEvent(String name) {
27
public OpModelSession[] getSessions() {
31
public void setSessions(OpModelSession[] sessions) {
32
this.sessions = sessions;
35
public String getName() {
39
//populate all sessions
40
public void refreshModel() {
41
if (sessions != null) {
42
for (int i = 0; i < sessions.length; i++) {
43
sessions[i].refreshModel();
48
public String toString(String tabs) {
50
String s = toString();
51
printTabs = ""; //$NON-NLS-1$
56
public String toString() {
57
String s = eventName + "\n"; //$NON-NLS-1$
58
if (sessions != null) {
59
for (int i = 0; i < sessions.length; i++) {
60
s += printTabs + "Session: "; //$NON-NLS-1$
61
s += sessions[i].toString(printTabs + "\t"); //$NON-NLS-1$