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
.io
.PrintWriter
;
18 import java
.util
.List
;
20 import org
.eclipse
.jdt
.annotation
.NonNull
;
21 import org
.eclipse
.tracecompass
.statesystem
.core
.backend
.IStateHistoryBackend
;
22 import org
.eclipse
.tracecompass
.statesystem
.core
.interval
.ITmfStateInterval
;
23 import org
.eclipse
.tracecompass
.statesystem
.core
.statevalue
.ITmfStateValue
;
26 * An implement of a state history back-end to simply discards *all* the
27 * intervals it receives. Obviously, no queries can be done on it. It is useful
28 * for using with a StateSystem on which you will only want to do "ongoing"
31 * @author Alexandre Montplaisir
33 public class NullBackend
implements IStateHistoryBackend
{
35 private final @NonNull String ssid
;
41 * The state system's id
43 public NullBackend(@NonNull String ssid
) {
48 public String
getSSID() {
53 public long getStartTime() {
58 public long getEndTime() {
63 * The interval will be discarded when using a null backend.
66 public void insertPastState(long stateStartTime
, long stateEndTime
,
67 int quark
, ITmfStateValue value
) {
68 /* The interval is always discarded. */
72 public void finishedBuilding(long endTime
) {
77 public FileInputStream
supplyAttributeTreeReader() {
82 public File
supplyAttributeTreeWriterFile() {
87 public long supplyAttributeTreeWriterFilePosition() {
92 public void removeFiles() {
97 public void dispose() {
102 * Null back-ends cannot run queries. Nothing will be put in
106 public void doQuery(List
<ITmfStateInterval
> currentStateInfo
, long t
) {
107 /* Cannot do past queries */
111 * Null back-ends cannot run queries. 'null' will be returned.
113 * @return Always returns null.
116 public ITmfStateInterval
doSingularQuery(long t
, int attributeQuark
) {
117 /* Cannot do past queries */
122 public void debugPrint(PrintWriter writer
) {
123 writer
.println("Null history backend"); //$NON-NLS-1$
This page took 0.032848 seconds and 5 git commands to generate.