~ubuntu-branches/ubuntu/trusty/eclipse-linuxtools/trusty

« back to all changes in this revision

Viewing changes to lttng/org.eclipse.linuxtools.lttng2.core/src/org/eclipse/linuxtools/internal/lttng2/core/control/model/impl/SessionInfo.java

  • Committer: Package Import Robot
  • Author(s): tony mancill
  • Date: 2013-05-13 21:43:22 UTC
  • mfrom: (1.2.1) (2.1.2 experimental)
  • Revision ID: package-import@ubuntu.com-20130513214322-6frgd9du1n0w2uo7
Tags: 1.2.1-1
* Team upload.
* New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/**********************************************************************
2
2
 * Copyright (c) 2012 Ericsson
3
 
 * 
 
3
 *
4
4
 * All rights reserved. This program and the accompanying materials are
5
5
 * made available under the terms of the Eclipse Public License v1.0 which
6
6
 * accompanies this distribution, and is available at
7
7
 * http://www.eclipse.org/legal/epl-v10.html
8
 
 * 
9
 
 * Contributors: 
 
8
 *
 
9
 * Contributors:
10
10
 *   Bernd Hufmann - Initial API and implementation
11
11
 **********************************************************************/
12
12
package org.eclipse.linuxtools.internal.lttng2.core.control.model.impl;
22
22
/**
23
23
 * <p>
24
24
 * Implementation of the trace session interface (ISessionInfo) to store session
25
 
 * related data. 
 
25
 * related data.
26
26
 * </p>
27
 
 * 
 
27
 *
28
28
 * @author Bernd Hufmann
29
29
 */
30
30
public class SessionInfo extends TraceInfo implements ISessionInfo {
36
36
     * The trace session state.
37
37
     */
38
38
    private TraceSessionState fState = TraceSessionState.INACTIVE;
39
 
    /** 
 
39
    /**
40
40
     * The trace session path for storing traces.
41
41
     */
42
42
    private String fSessionPath = ""; //$NON-NLS-1$
43
43
    /**
44
44
     * The domains information of this session.
45
45
     */
46
 
    private List<IDomainInfo> fDomains = new ArrayList<IDomainInfo>();
 
46
    private final List<IDomainInfo> fDomains = new ArrayList<IDomainInfo>();
47
47
 
48
48
    // ------------------------------------------------------------------------
49
49
    // Constructors
64
64
        super(other);
65
65
        fState = other.fState;
66
66
        fSessionPath = other.fSessionPath;
67
 
        
 
67
 
68
68
        for (Iterator<IDomainInfo> iterator = other.fDomains.iterator(); iterator.hasNext();) {
69
69
            IDomainInfo domain = iterator.next();
70
70
            if (domain instanceof DomainInfo) {
74
74
            }
75
75
        }
76
76
    }
77
 
    
 
77
 
78
78
    // ------------------------------------------------------------------------
79
79
    // Accessors
80
80
    // ------------------------------------------------------------------------
108
108
            fState = TraceSessionState.ACTIVE;
109
109
        }
110
110
    }
111
 
    
 
111
 
112
112
    /*
113
113
     * (non-Javadoc)
114
114
     * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.ISessionInfo#getSessionPath()
143
143
    @Override
144
144
    public void setDomains(List<IDomainInfo> domains) {
145
145
        for (Iterator<IDomainInfo> iterator = domains.iterator(); iterator.hasNext();) {
146
 
            IDomainInfo domainInfo = (IDomainInfo) iterator.next();
 
146
            IDomainInfo domainInfo = iterator.next();
147
147
            fDomains.add(domainInfo);
148
148
        }
149
149
    }
159
159
    public void addDomain(IDomainInfo domainInfo) {
160
160
        fDomains.add(domainInfo);
161
161
    }
162
 
    
 
162
 
163
163
    /*
164
164
     * (non-Javadoc)
165
165
     * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceInfo#hashCode()
224
224
            output.append(fState);
225
225
            output.append(",Domains=");
226
226
            for (Iterator<IDomainInfo> iterator = fDomains.iterator(); iterator.hasNext();) {
227
 
                IDomainInfo domain = (IDomainInfo) iterator.next();
 
227
                IDomainInfo domain = iterator.next();
228
228
                output.append(domain.toString());
229
229
            }
230
230
            output.append(")]");