1 /*******************************************************************************
2 * Copyright (c) 2009, 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 * Francois Chouinard - Initial API and implementation
11 *******************************************************************************/
13 package org
.eclipse
.linuxtools
.tmf
.core
.request
;
15 import org
.eclipse
.linuxtools
.tmf
.core
.event
.ITmfEvent
;
16 import org
.eclipse
.linuxtools
.tmf
.core
.event
.TmfTimeRange
;
19 * <b><u>TmfEventRequest</u></b>
21 * Implement me. Please.
23 public abstract class TmfEventRequest
<T
extends ITmfEvent
> extends TmfDataRequest
<T
> implements ITmfEventRequest
<T
> {
25 // ------------------------------------------------------------------------
27 // ------------------------------------------------------------------------
29 private final TmfTimeRange fRange
; // The requested events time range
31 // ------------------------------------------------------------------------
33 // ------------------------------------------------------------------------
38 public TmfEventRequest(Class
<T
> dataType
) {
39 this(dataType
, TmfTimeRange
.Eternity
, 0, ALL_DATA
, DEFAULT_BLOCK_SIZE
, ExecutionType
.FOREGROUND
);
42 public TmfEventRequest(Class
<T
> dataType
, ExecutionType execType
) {
43 this(dataType
, TmfTimeRange
.Eternity
, 0, ALL_DATA
, DEFAULT_BLOCK_SIZE
, execType
);
49 public TmfEventRequest(Class
<T
> dataType
, TmfTimeRange range
) {
50 this(dataType
, range
, 0, ALL_DATA
, DEFAULT_BLOCK_SIZE
, ExecutionType
.FOREGROUND
);
53 public TmfEventRequest(Class
<T
> dataType
, TmfTimeRange range
, ExecutionType execType
) {
54 this(dataType
, range
, 0, ALL_DATA
, DEFAULT_BLOCK_SIZE
, execType
);
61 public TmfEventRequest(Class
<T
> dataType
, TmfTimeRange range
, int nbRequested
) {
62 this(dataType
, range
, 0, nbRequested
, DEFAULT_BLOCK_SIZE
, ExecutionType
.FOREGROUND
);
65 public TmfEventRequest(Class
<T
> dataType
, TmfTimeRange range
, int nbRequested
, ExecutionType execType
) {
66 this(dataType
, range
, 0, nbRequested
, DEFAULT_BLOCK_SIZE
, execType
);
72 * @param blockSize Size of the largest blocks expected
74 public TmfEventRequest(Class
<T
> dataType
, TmfTimeRange range
, int nbRequested
, int blockSize
) {
75 this(dataType
, range
, 0, nbRequested
, blockSize
, ExecutionType
.FOREGROUND
);
78 public TmfEventRequest(Class
<T
> dataType
, TmfTimeRange range
, int nbRequested
, int blockSize
, ExecutionType execType
) {
79 this(dataType
, range
, 0, nbRequested
, blockSize
, execType
);
82 public TmfEventRequest(Class
<T
> dataType
, TmfTimeRange range
, int index
, int nbRequested
, int blockSize
, ExecutionType execType
) {
83 super(dataType
, index
, nbRequested
, blockSize
, execType
);
87 // ------------------------------------------------------------------------
89 // ------------------------------------------------------------------------
92 * @return the requested time range
95 public TmfTimeRange
getRange() {
99 // ------------------------------------------------------------------------
101 // ------------------------------------------------------------------------
104 * this method is called by the event provider to set the index corresponding
105 * to the time range start time once it is known
106 * @param index the start time index
109 public void setStartIndex(int index
) {
113 // ------------------------------------------------------------------------
115 // ------------------------------------------------------------------------
118 // All requests have a unique id
119 public int hashCode() {
120 return getRequestId();
124 public boolean equals(Object other
) {
125 if (other
instanceof TmfEventRequest
<?
>) {
126 TmfEventRequest
<?
> request
= (TmfEventRequest
<?
>) other
;
127 return super.equals(other
) && request
.fRange
.equals(fRange
);
133 @SuppressWarnings("nls")
134 public String
toString() {
135 return "[TmfEventRequest(" + getRequestId() + "," + getDataType().getSimpleName()
136 + "," + getRange() + "," + getIndex() + "," + getNbRequested() + "," + getBlockSize() + ")]";
This page took 0.037893 seconds and 6 git commands to generate.