1526a32b3df48f971faf7a3aa8c287fef91ec190
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
.linuxtools
.internal
.tmf
.core
.statesystem
.backends
;
16 import java
.io
.FileInputStream
;
17 import java
.io
.PrintWriter
;
18 import java
.util
.List
;
20 import org
.eclipse
.linuxtools
.tmf
.core
.interval
.ITmfStateInterval
;
21 import org
.eclipse
.linuxtools
.tmf
.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
31 public class NullBackend
implements IStateHistoryBackend
{
36 public NullBackend() {}
39 public long getStartTime() {
44 public long getEndTime() {
49 * The interval will be discarded when using a null backend.
52 public void insertPastState(long stateStartTime
, long stateEndTime
,
53 int quark
, ITmfStateValue value
) {
54 /* The interval is always discarded. */
58 public void finishedBuilding(long endTime
) {
63 public FileInputStream
supplyAttributeTreeReader() {
68 public File
supplyAttributeTreeWriterFile() {
73 public long supplyAttributeTreeWriterFilePosition() {
78 public void removeFiles() {
83 public void dispose() {
88 * Null back-ends cannot run queries. Nothing will be put in
92 public void doQuery(List
<ITmfStateInterval
> currentStateInfo
, long t
) {
93 /* Cannot do past queries */
97 * Null back-ends cannot run queries. 'null' will be returned.
99 * @return Always returns null.
102 public ITmfStateInterval
doSingularQuery(long t
, int attributeQuark
) {
103 /* Cannot do past queries */
108 * Null back-ends cannot run queries.
110 * @return Always returns false.
113 public boolean checkValidTime(long t
) {
114 /* Cannot do past queries */
119 public void debugPrint(PrintWriter writer
) {
120 writer
.println("Null history backend"); //$NON-NLS-1$
This page took 0.03674 seconds and 4 git commands to generate.