1 /*******************************************************************************
2 * Copyright (c) 2013 École Polytechnique de Montréal
4 * All rights reserved. This program and the accompanying materials are made
5 * 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 * Geneviève Bastien - Initial implementation and API
11 *******************************************************************************/
13 package org
.eclipse
.linuxtools
.tmf
.core
.event
.matching
;
15 import java
.util
.ArrayList
;
16 import java
.util
.List
;
18 import org
.eclipse
.linuxtools
.tmf
.core
.trace
.ITmfTrace
;
21 * Class that does something with a match.
23 * This default implementation of the class just adds it to a list of matches
25 * @author Geneviève Bastien
28 public class TmfEventMatches
implements IMatchProcessingUnit
{
31 * The list of matches found
33 private final List
<TmfEventDependency
> fMatches
;
38 public TmfEventMatches() {
39 fMatches
= new ArrayList
<>();
43 * IMatchProcessingUnit overrides
47 public void init(ITmfTrace
[] fTraces
) {
52 public void addMatch(TmfEventDependency match
) {
57 public void matchingEnded() {
62 public int countMatches() {
63 return fMatches
.size();
67 * Returns the match at the specified index
70 * The index of the match to get
71 * @return The match at index or null or not present
73 public TmfEventDependency
getMatch(int index
) {
74 return fMatches
.get(index
);
78 public String
toString() {
79 return getClass().getSimpleName() + " [ Number of matches found: " + fMatches
.size() + " ]"; //$NON-NLS-1$ //$NON-NLS-2$
This page took 0.032565 seconds and 5 git commands to generate.