1 /*******************************************************************************
2 * Copyright (c) 2012, 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 * Patrick Tasse - Initial API and implementation
11 *******************************************************************************/
13 package org
.eclipse
.tracecompass
.tmf
.core
.trace
.text
;
15 import java
.util
.regex
.Matcher
;
17 import org
.eclipse
.tracecompass
.tmf
.core
.trace
.TmfContext
;
18 import org
.eclipse
.tracecompass
.tmf
.core
.trace
.location
.ITmfLocation
;
21 * Implementation of a TmfContext for text traces.
23 public class TextTraceContext
extends TmfContext
{
25 /** The Matcher object for the first line. */
26 public Matcher firstLineMatcher
;
27 /** The first line string */
28 public String firstLine
;
29 /** The location of the next line */
30 public long nextLineLocation
;
40 public TextTraceContext(final ITmfLocation location
, final long rank
) {
41 super(location
, rank
);
48 * the other TextTraceContext
50 public TextTraceContext(TextTraceContext other
) {
51 this(other
.getLocation(), other
.getRank());
52 firstLine
= other
.firstLine
;
53 firstLineMatcher
= other
.firstLineMatcher
;
54 nextLineLocation
= other
.nextLineLocation
;
58 public int hashCode() {
60 int result
= super.hashCode();
61 result
= prime
* result
+ ((firstLine
== null) ?
0 : firstLine
.hashCode());
62 result
= prime
* result
+ ((firstLineMatcher
== null) ?
0 : firstLineMatcher
.hashCode());
63 result
= prime
* result
+ (int) (nextLineLocation ^
(nextLineLocation
>>> 32));
68 public boolean equals(Object obj
) {
72 if (!super.equals(obj
)) {
75 if (getClass() != obj
.getClass()) {
78 TextTraceContext other
= (TextTraceContext
) obj
;
79 if (firstLine
== null) {
80 if (other
.firstLine
!= null) {
83 } else if (!firstLine
.equals(other
.firstLine
)) {
86 if (firstLineMatcher
== null) {
87 if (other
.firstLineMatcher
!= null) {
90 } else if (!firstLineMatcher
.equals(other
.firstLineMatcher
)) {
93 if (nextLineLocation
!= other
.nextLineLocation
) {
This page took 0.039165 seconds and 5 git commands to generate.