Fix javadoc warnings
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.core / src / org / eclipse / linuxtools / tmf / core / request / TmfEventRequest.java
CommitLineData
8c8bf09f
ASL
1/*******************************************************************************
2 * Copyright (c) 2009, 2010 Ericsson
3 *
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
8 *
9 * Contributors:
10 * Francois Chouinard - Initial API and implementation
11 *******************************************************************************/
12
6c13869b 13package org.eclipse.linuxtools.tmf.core.request;
8c8bf09f 14
72f1e62a 15import org.eclipse.linuxtools.tmf.core.event.ITmfEvent;
6c13869b 16import org.eclipse.linuxtools.tmf.core.event.TmfTimeRange;
8c8bf09f
ASL
17
18/**
19 * <b><u>TmfEventRequest</u></b>
20 * <p>
21 * Implement me. Please.
22 */
72f1e62a 23public abstract class TmfEventRequest<T extends ITmfEvent> extends TmfDataRequest<T> implements ITmfEventRequest<T> {
8c8bf09f
ASL
24
25 // ------------------------------------------------------------------------
26 // Attributes
27 // ------------------------------------------------------------------------
28
29 private final TmfTimeRange fRange; // The requested events time range
30
31 // ------------------------------------------------------------------------
32 // Constructors
33 // ------------------------------------------------------------------------
34
35 /**
0d9a6d76
FC
36 * Request all the events of a given type (high priority)
37 * Events are returned in blocks of the default size (DEFAULT_BLOCK_SIZE).
38 *
39 * @param dataType the requested data type
8c8bf09f 40 */
951d134a 41 public TmfEventRequest(Class<T> dataType) {
a4115405 42 this(dataType, TmfTimeRange.ETERNITY, 0, ALL_DATA, DEFAULT_BLOCK_SIZE, ExecutionType.FOREGROUND);
550d787e
FC
43 }
44
0d9a6d76
FC
45 /**
46 * Request all the events of a given type (given priority)
47 * Events are returned in blocks of the default size (DEFAULT_BLOCK_SIZE).
48 *
49 * @param dataType the requested data type
50 * @param priority the requested execution priority
51 */
52 public TmfEventRequest(Class<T> dataType, ExecutionType priority) {
53 this(dataType, TmfTimeRange.ETERNITY, 0, ALL_DATA, DEFAULT_BLOCK_SIZE, priority);
8c8bf09f
ASL
54 }
55
56 /**
0d9a6d76
FC
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).
59 *
60 * @param dataType the requested data type
61 * @param range the time range of the requested events
8c8bf09f 62 */
951d134a 63 public TmfEventRequest(Class<T> dataType, TmfTimeRange range) {
a79913eb 64 this(dataType, range, 0, ALL_DATA, DEFAULT_BLOCK_SIZE, ExecutionType.FOREGROUND);
550d787e
FC
65 }
66
0d9a6d76
FC
67 /**
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).
70 *
71 * @param dataType the requested data type
72 * @param range the time range of the requested events
73 * @param priority the requested execution priority
74 */
75 public TmfEventRequest(Class<T> dataType, TmfTimeRange range, ExecutionType priority) {
76 this(dataType, range, 0, ALL_DATA, DEFAULT_BLOCK_SIZE, priority);
8c8bf09f
ASL
77 }
78
79 /**
0d9a6d76
FC
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).
82 *
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
8c8bf09f 86 */
951d134a 87 public TmfEventRequest(Class<T> dataType, TmfTimeRange range, int nbRequested) {
a79913eb 88 this(dataType, range, 0, nbRequested, DEFAULT_BLOCK_SIZE, ExecutionType.FOREGROUND);
550d787e
FC
89 }
90
0d9a6d76
FC
91 /**
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).
94 *
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
99 */
100 public TmfEventRequest(Class<T> dataType, TmfTimeRange range, int nbRequested, ExecutionType priority) {
101 this(dataType, range, 0, nbRequested, DEFAULT_BLOCK_SIZE, priority);
8c8bf09f
ASL
102 }
103
104 /**
0d9a6d76
FC
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.
107 *
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
8c8bf09f 112 */
951d134a 113 public TmfEventRequest(Class<T> dataType, TmfTimeRange range, int nbRequested, int blockSize) {
a79913eb 114 this(dataType, range, 0, nbRequested, blockSize, ExecutionType.FOREGROUND);
550d787e
FC
115 }
116
0d9a6d76
FC
117 /**
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.
120 *
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
126 */
127 public TmfEventRequest(Class<T> dataType, TmfTimeRange range, int nbRequested, int blockSize, ExecutionType priority) {
128 this(dataType, range, 0, nbRequested, blockSize, priority);
a79913eb
FC
129 }
130
0d9a6d76
FC
131 /**
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.
134 *
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
141 */
142 public TmfEventRequest(Class<T> dataType, TmfTimeRange range, int index, int nbRequested, int blockSize, ExecutionType priority) {
143 super(dataType, index, nbRequested, blockSize, priority);
8c8bf09f
ASL
144 fRange = range;
145 }
146
147 // ------------------------------------------------------------------------
148 // Accessors
149 // ------------------------------------------------------------------------
150
151 /**
152 * @return the requested time range
153 */
d4011df2
FC
154 @Override
155 public TmfTimeRange getRange() {
8c8bf09f
ASL
156 return fRange;
157 }
158
a79913eb
FC
159 // ------------------------------------------------------------------------
160 // Setters
161 // ------------------------------------------------------------------------
162
163 /**
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
0d9a6d76
FC
166 *
167 * @param index the start index
a79913eb
FC
168 */
169 @Override
170 public void setStartIndex(int index) {
171 setIndex(index);
172 }
173
2fb2eb37
FC
174 // ------------------------------------------------------------------------
175 // Object
176 // ------------------------------------------------------------------------
177
178 @Override
179 // All requests have a unique id
180 public int hashCode() {
181 return getRequestId();
182 }
183
184 @Override
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);
189 }
190 return false;
191 }
192
193 @Override
3b38ea61 194 @SuppressWarnings("nls")
2fb2eb37
FC
195 public String toString() {
196 return "[TmfEventRequest(" + getRequestId() + "," + getDataType().getSimpleName()
a79913eb 197 + "," + getRange() + "," + getIndex() + "," + getNbRequested() + "," + getBlockSize() + ")]";
2fb2eb37
FC
198 }
199
8c8bf09f 200}
This page took 0.048595 seconds and 5 git commands to generate.