tmf: Transition custom parsers to the new location
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.core / src / org / eclipse / linuxtools / tmf / core / event / TmfEventType.java
index 14cff763c60c8b51415f9f3cc47cd9b9fab8964c..9cc400a0a952011f61727b5fb92b675536201ff1 100644 (file)
@@ -1,11 +1,11 @@
 /*******************************************************************************
- * Copyright (c) 2009, 2012 Ericsson
- * 
+ * Copyright (c) 2009, 2013 Ericsson
+ *
  * 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:
  *   Francois Chouinard - Initial API and implementation
  *   Francois Chouinard - Updated as per TMF Event Model 1.0
@@ -15,22 +15,22 @@ package org.eclipse.linuxtools.tmf.core.event;
 
 /**
  * A basic implementation of ITmfEventType.
- * 
+ *
  * @version 1.0
  * @author Francois Chouinard
- * 
+ *
  * @see ITmfEvent
  * @see ITmfEventField
  */
-public class TmfEventType implements ITmfEventType, Cloneable {
+public class TmfEventType implements ITmfEventType {
 
     // ------------------------------------------------------------------------
     // Attributes
     // ------------------------------------------------------------------------
 
-    private String fContext;
-    private String fTypeId;
-    private ITmfEventField fRootField;
+    private final String fContext;
+    private final String fTypeId;
+    private final ITmfEventField fRootField;
 
     // ------------------------------------------------------------------------
     // Constructors
@@ -45,7 +45,7 @@ public class TmfEventType implements ITmfEventType, Cloneable {
 
     /**
      * Full constructor
-     * 
+     *
      * @param context the type context
      * @param typeId the type name
      * @param root the root field
@@ -64,7 +64,7 @@ public class TmfEventType implements ITmfEventType, Cloneable {
 
     /**
      * Copy constructor
-     * 
+     *
      * @param type the other type
      */
     public TmfEventType(final ITmfEventType type) {
@@ -80,74 +80,35 @@ public class TmfEventType implements ITmfEventType, Cloneable {
     // ITmfEventType
     // ------------------------------------------------------------------------
 
-    /* (non-Javadoc)
-     * @see org.eclipse.linuxtools.tmf.core.event.ITmfEventType#getContext()
-     */
     @Override
     public String getContext() {
         return fContext;
     }
 
-    /* (non-Javadoc)
-     * @see org.eclipse.linuxtools.tmf.core.event.ITmfEventType#getName()
-     */
     @Override
     public String getName() {
         return fTypeId;
     }
 
-    /* (non-Javadoc)
-     * @see org.eclipse.linuxtools.tmf.core.event.ITmfEventType#getRootField()
-     */
     @Override
     public ITmfEventField getRootField() {
         return fRootField;
     }
 
-    /* (non-Javadoc)
-     * @see org.eclipse.linuxtools.tmf.core.event.ITmfEventType#getFieldNames()
-     */
     @Override
     public String[] getFieldNames() {
-        return (fRootField != null) ? fRootField.getFieldNames() : null;
+        return (fRootField != null) ? fRootField.getFieldNames() : new String[0];
     }
 
-    /* (non-Javadoc)
-     * @see org.eclipse.linuxtools.tmf.core.event.ITmfEventType#getFieldName(int)
-     */
     @Override
     public String getFieldName(final int index) {
         return (fRootField != null) ? fRootField.getFieldName(index) : null;
     }
 
-    // ------------------------------------------------------------------------
-    // Cloneable
-    // ------------------------------------------------------------------------
-
-    /* (non-Javadoc)
-     * @see java.lang.Object#clone()
-     */
-    @Override
-    public TmfEventType clone() {
-        TmfEventType clone = null;
-        try {
-            clone = (TmfEventType) super.clone();
-            clone.fContext = fContext;
-            clone.fTypeId = fTypeId;
-            clone.fRootField = (fRootField != null) ? fRootField.clone() : null;
-        }
-        catch (final CloneNotSupportedException e) {
-        }
-        return clone;
-    }
-
     // ------------------------------------------------------------------------
     // Object
     // ------------------------------------------------------------------------
 
-    /* (non-Javadoc)
-     * @see java.lang.Object#hashCode()
-     */
     @Override
     public int hashCode() {
         final int prime = 31;
@@ -157,9 +118,6 @@ public class TmfEventType implements ITmfEventType, Cloneable {
         return result;
     }
 
-    /* (non-Javadoc)
-     * @see java.lang.Object#equals(java.lang.Object)
-     */
     @Override
     public boolean equals(final Object obj) {
         if (this == obj) {
@@ -181,13 +139,10 @@ public class TmfEventType implements ITmfEventType, Cloneable {
         return true;
     }
 
-    /* (non-Javadoc)
-     * @see java.lang.Object#toString()
-     */
     @Override
     @SuppressWarnings("nls")
     public String toString() {
         return "TmfEventType [fContext=" + fContext + ", fTypeId=" + fTypeId + "]";
     }
 
-}
\ No newline at end of file
+}
This page took 0.026078 seconds and 5 git commands to generate.