1 /*******************************************************************************
2 * Copyright (c) 2013, 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 * Alexandre Montplaisir - Initial API and implementation
11 *******************************************************************************/
13 package org
.eclipse
.tracecompass
.internal
.statesystem
.core
.backend
;
16 import java
.io
.FileInputStream
;
17 import java
.util
.List
;
19 import org
.eclipse
.jdt
.annotation
.NonNull
;
20 import org
.eclipse
.tracecompass
.statesystem
.core
.backend
.IStateHistoryBackend
;
21 import org
.eclipse
.tracecompass
.statesystem
.core
.interval
.ITmfStateInterval
;
22 import org
.eclipse
.tracecompass
.statesystem
.core
.statevalue
.ITmfStateValue
;
25 * An implement of a state history back-end to simply discards *all* the
26 * intervals it receives. Obviously, no queries can be done on it. It is useful
27 * for using with a StateSystem on which you will only want to do "ongoing"
30 * @author Alexandre Montplaisir
32 public class NullBackend
implements IStateHistoryBackend
{
34 private final @NonNull String ssid
;
40 * The state system's id
42 public NullBackend(@NonNull String ssid
) {
47 public String
getSSID() {
52 public long getStartTime() {
57 public long getEndTime() {
62 * The interval will be discarded when using a null backend.
65 public void insertPastState(long stateStartTime
, long stateEndTime
,
66 int quark
, ITmfStateValue value
) {
67 /* The interval is always discarded. */
71 public void finishedBuilding(long endTime
) {
76 public FileInputStream
supplyAttributeTreeReader() {
81 public File
supplyAttributeTreeWriterFile() {
86 public long supplyAttributeTreeWriterFilePosition() {
91 public void removeFiles() {
96 public void dispose() {
101 * Null back-ends cannot run queries. Nothing will be put in
105 public void doQuery(List
<ITmfStateInterval
> currentStateInfo
, long t
) {
106 /* Cannot do past queries */
110 * Null back-ends cannot run queries. 'null' will be returned.
112 * @return Always returns null.
115 public ITmfStateInterval
doSingularQuery(long t
, int attributeQuark
) {
116 /* Cannot do past queries */
This page took 0.033276 seconds and 5 git commands to generate.