1 /*******************************************************************************
2 * Copyright (c) 2010 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 * Patrick Tasse - Initial API and implementation
11 *******************************************************************************/
13 package org
.eclipse
.linuxtools
.internal
.tmf
.ui
.parsers
.custom
;
15 import java
.util
.regex
.Matcher
;
17 import org
.eclipse
.linuxtools
.internal
.tmf
.ui
.parsers
.custom
.CustomTxtTraceDefinition
.InputLine
;
18 import org
.eclipse
.linuxtools
.tmf
.core
.trace
.ITmfLocation
;
19 import org
.eclipse
.linuxtools
.tmf
.core
.trace
.TmfContext
;
21 public class CustomTxtTraceContext
extends TmfContext
{
22 public Matcher firstLineMatcher
;
23 public String firstLine
;
24 public long nextLineLocation
;
25 public InputLine inputLine
;
27 public CustomTxtTraceContext(ITmfLocation location
, long rank
) {
28 super(location
, rank
);
32 * @see java.lang.Object#hashCode()
35 public int hashCode() {
37 int result
= super.hashCode();
38 result
= prime
* result
+ ((firstLine
== null) ?
0 : firstLine
.hashCode());
39 result
= prime
* result
+ ((firstLineMatcher
== null) ?
0 : firstLineMatcher
.hashCode());
40 result
= prime
* result
+ ((inputLine
== null) ?
0 : inputLine
.hashCode());
41 result
= prime
* result
+ (int) (nextLineLocation ^
(nextLineLocation
>>> 32));
46 * @see java.lang.Object#equals(java.lang.Object)
49 public boolean equals(Object obj
) {
53 if (!super.equals(obj
)) {
56 if (!(obj
instanceof CustomTxtTraceContext
)) {
59 CustomTxtTraceContext other
= (CustomTxtTraceContext
) obj
;
60 if (firstLine
== null) {
61 if (other
.firstLine
!= null) {
64 } else if (!firstLine
.equals(other
.firstLine
)) {
67 if (firstLineMatcher
== null) {
68 if (other
.firstLineMatcher
!= null) {
71 } else if (!firstLineMatcher
.equals(other
.firstLineMatcher
)) {
74 if (inputLine
== null) {
75 if (other
.inputLine
!= null) {
78 } else if (!inputLine
.equals(other
.inputLine
)) {
81 if (nextLineLocation
!= other
.nextLineLocation
) {