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 // ------------------------------------------------------------------------
36 * Request all the events of a given type (high priority)
37 * Events are returned in blocks of the default size (DEFAULT_BLOCK_SIZE).
39 * @param dataType the requested data type
41 public TmfEventRequest(Class
<T
> dataType
) {
42 this(dataType
, TmfTimeRange
.ETERNITY
, 0, ALL_DATA
, DEFAULT_BLOCK_SIZE
, ExecutionType
.FOREGROUND
);
46 * Request all the events of a given type (given priority)
47 * Events are returned in blocks of the default size (DEFAULT_BLOCK_SIZE).
49 * @param dataType the requested data type
50 * @param priority the requested execution priority
52 public TmfEventRequest(Class
<T
> dataType
, ExecutionType priority
) {
53 this(dataType
, TmfTimeRange
.ETERNITY
, 0, ALL_DATA
, DEFAULT_BLOCK_SIZE
, priority
);
57 * Request all the events of a given type for the given time range (high priority)
58 * Events are returned in blocks of the default size (DEFAULT_BLOCK_SIZE).
60 * @param dataType the requested data type
61 * @param range the time range of the requested events
63 public TmfEventRequest(Class
<T
> dataType
, TmfTimeRange range
) {
64 this(dataType
, range
, 0, ALL_DATA
, DEFAULT_BLOCK_SIZE
, ExecutionType
.FOREGROUND
);
68 * Request all the events of a given type for the given time range (given priority)
69 * Events are returned in blocks of the default size (DEFAULT_BLOCK_SIZE).
71 * @param dataType the requested data type
72 * @param range the time range of the requested events
73 * @param priority the requested execution priority
75 public TmfEventRequest(Class
<T
> dataType
, TmfTimeRange range
, ExecutionType priority
) {
76 this(dataType
, range
, 0, ALL_DATA
, DEFAULT_BLOCK_SIZE
, priority
);
80 * Request 'n' events of a given type from the given time range (high priority)
81 * Events are returned in blocks of the default size (DEFAULT_BLOCK_SIZE).
83 * @param dataType the requested data type
84 * @param range the time range of the requested events
85 * @param nbRequested the number of events requested
87 public TmfEventRequest(Class
<T
> dataType
, TmfTimeRange range
, int nbRequested
) {
88 this(dataType
, range
, 0, nbRequested
, DEFAULT_BLOCK_SIZE
, ExecutionType
.FOREGROUND
);
92 * Request 'n' events of a given type for the given time range (given priority)
93 * Events are returned in blocks of the default size (DEFAULT_BLOCK_SIZE).
95 * @param dataType the requested data type
96 * @param range the time range of the requested events
97 * @param nbRequested the number of events requested
98 * @param priority the requested execution priority
100 public TmfEventRequest(Class
<T
> dataType
, TmfTimeRange range
, int nbRequested
, ExecutionType priority
) {
101 this(dataType
, range
, 0, nbRequested
, DEFAULT_BLOCK_SIZE
, priority
);
105 * Request 'n' events of a given type for the given time range (high priority).
106 * Events are returned in blocks of the given size.
108 * @param dataType the requested data type
109 * @param range the time range of the requested events
110 * @param nbRequested the number of events requested
111 * @param blockSize the number of events per block
113 public TmfEventRequest(Class
<T
> dataType
, TmfTimeRange range
, int nbRequested
, int blockSize
) {
114 this(dataType
, range
, 0, nbRequested
, blockSize
, ExecutionType
.FOREGROUND
);
118 * Request 'n' events of a given type for the given time range (given priority).
119 * Events are returned in blocks of the given size.
121 * @param dataType the requested data type
122 * @param range the time range of the requested events
123 * @param nbRequested the number of events requested
124 * @param blockSize the number of events per block
125 * @param priority the requested execution priority
127 public TmfEventRequest(Class
<T
> dataType
, TmfTimeRange range
, int nbRequested
, int blockSize
, ExecutionType priority
) {
128 this(dataType
, range
, 0, nbRequested
, blockSize
, priority
);
132 * Request 'n' events of a given type for the given time range (given priority).
133 * Events are returned in blocks of the given size.
135 * @param dataType the requested data type
136 * @param range the time range of the requested events
137 * @param index the index of the first event to retrieve
138 * @param nbRequested the number of events requested
139 * @param blockSize the number of events per block
140 * @param priority the requested execution priority
142 public TmfEventRequest(Class
<T
> dataType
, TmfTimeRange range
, int index
, int nbRequested
, int blockSize
, ExecutionType priority
) {
143 super(dataType
, index
, nbRequested
, blockSize
, priority
);
147 // ------------------------------------------------------------------------
149 // ------------------------------------------------------------------------
152 * @return the requested time range
155 public TmfTimeRange
getRange() {
159 // ------------------------------------------------------------------------
161 // ------------------------------------------------------------------------
164 * this method is called by the event provider to set the index corresponding
165 * to the time range start time once it is known
167 * @param index the start index
170 public void setStartIndex(int index
) {
174 // ------------------------------------------------------------------------
176 // ------------------------------------------------------------------------
179 // All requests have a unique id
180 public int hashCode() {
181 return getRequestId();
185 public boolean equals(Object other
) {
186 if (other
instanceof TmfEventRequest
<?
>) {
187 TmfEventRequest
<?
> request
= (TmfEventRequest
<?
>) other
;
188 return super.equals(other
) && request
.fRange
.equals(fRange
);
194 @SuppressWarnings("nls")
195 public String
toString() {
196 return "[TmfEventRequest(" + getRequestId() + "," + getDataType().getSimpleName()
197 + "," + getRange() + "," + getIndex() + "," + getNbRequested() + "," + getBlockSize() + ")]";
This page took 0.037732 seconds and 6 git commands to generate.