1 /*******************************************************************************
2 * Copyright (c) 2013 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
.statesystem
.core
.backend
;
16 import java
.io
.FileInputStream
;
17 import java
.io
.PrintWriter
;
18 import java
.util
.List
;
20 import org
.eclipse
.tracecompass
.statesystem
.core
.interval
.ITmfStateInterval
;
21 import org
.eclipse
.tracecompass
.statesystem
.core
.statevalue
.ITmfStateValue
;
24 * An implement of a state history back-end to simply discards *all* the
25 * intervals it receives. Obviously, no queries can be done on it. It is useful
26 * for using with a StateSystem on which you will only want to do "ongoing"
29 * @author Alexandre Montplaisir
32 public class NullBackend
implements IStateHistoryBackend
{
37 public NullBackend() {}
40 public long getStartTime() {
45 public long getEndTime() {
50 * The interval will be discarded when using a null backend.
53 public void insertPastState(long stateStartTime
, long stateEndTime
,
54 int quark
, ITmfStateValue value
) {
55 /* The interval is always discarded. */
59 public void finishedBuilding(long endTime
) {
64 public FileInputStream
supplyAttributeTreeReader() {
69 public File
supplyAttributeTreeWriterFile() {
74 public long supplyAttributeTreeWriterFilePosition() {
79 public void removeFiles() {
84 public void dispose() {
89 * Null back-ends cannot run queries. Nothing will be put in
93 public void doQuery(List
<ITmfStateInterval
> currentStateInfo
, long t
) {
94 /* Cannot do past queries */
98 * Null back-ends cannot run queries. 'null' will be returned.
100 * @return Always returns null.
103 public ITmfStateInterval
doSingularQuery(long t
, int attributeQuark
) {
104 /* Cannot do past queries */
109 public void debugPrint(PrintWriter writer
) {
110 writer
.println("Null history backend"); //$NON-NLS-1$
This page took 0.033134 seconds and 5 git commands to generate.