1 /**********************************************************************
2 * Copyright (c) 2013, 2014 Ericsson
4 * All rights reserved. This program and the accompanying materials are
5 * made available under the terms of the Eclipse Public License v1.0 which
6 * accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
10 * Bernd Hufmann - Initial API and implementation
11 **********************************************************************/
12 package org
.eclipse
.tracecompass
.internal
.lttng2
.control
.core
.model
.impl
;
14 import org
.eclipse
.tracecompass
.internal
.lttng2
.control
.core
.model
.ISnapshotInfo
;
18 * Implementation of the snapshot interface (ISnapshotInfo) to store snapshot
22 * @author Bernd Hufmann
24 public class SnapshotInfo
extends TraceInfo
implements ISnapshotInfo
{
26 // ------------------------------------------------------------------------
28 // ------------------------------------------------------------------------
29 /** The snapshot path for storing traces. */
30 private String fPath
= ""; //$NON-NLS-1$
31 /** The snapshot ID */
33 /** Flag whether snapshot is stored over the network or locally */
34 private boolean fIsStreamed
= false;
36 // ------------------------------------------------------------------------
38 // ------------------------------------------------------------------------
41 * @param name - name of base event
43 public SnapshotInfo(String name
) {
49 * @param other - the instance to copy
51 public SnapshotInfo(SnapshotInfo other
) {
55 fIsStreamed
= other
.fIsStreamed
;
58 // ------------------------------------------------------------------------
60 // ------------------------------------------------------------------------
63 public String
getSnapshotPath() {
68 public void setSnapshotPath(String path
) {
78 public void setId(int id
) {
83 public void setStreamedSnapshot(boolean isStreamed
) {
84 fIsStreamed
= isStreamed
;
88 public boolean isStreamedSnapshot() {
92 // ------------------------------------------------------------------------
94 // ------------------------------------------------------------------------
97 public int hashCode() {
99 int result
= super.hashCode();
100 result
= prime
* result
+ fId
;
101 result
= prime
* result
+ (fIsStreamed ?
1231 : 1237);
102 result
= prime
* result
+ ((fPath
== null) ?
0 : fPath
.hashCode());
107 public boolean equals(Object obj
) {
111 if (!super.equals(obj
)) {
114 if (getClass() != obj
.getClass()) {
117 SnapshotInfo other
= (SnapshotInfo
) obj
;
118 if (fId
!= other
.fId
) {
121 if (fIsStreamed
!= other
.fIsStreamed
) {
125 if (other
.fPath
!= null) {
128 } else if (!fPath
.equals(other
.fPath
)) {
134 @SuppressWarnings("nls")
136 public String
toString() {
137 StringBuffer output
= new StringBuffer();
138 output
.append("[SnapshotInfo(");
139 output
.append(super.toString());
140 output
.append(",snapshotPath=");
141 output
.append(fPath
);
142 output
.append(",ID=");
144 output
.append(",isStreamedSnapshot=");
145 output
.append(fIsStreamed
);
147 return output
.toString();
This page took 0.051048 seconds and 5 git commands to generate.