Package org.yamcs.utils
Class ParameterFormatter
- java.lang.Object
-
- org.yamcs.utils.ParameterFormatter
-
- All Implemented Interfaces:
Closeable,AutoCloseable
public class ParameterFormatter extends Object implements Closeable
Formats in tab separated format parameters. The list of the possible parameters has to be known in advance.
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanallParametersPresentprotected booleanfirstprotected booleankeepValuesprotected intlinesReceivedprotected intlinesSavedprotected booleanprintMonitoringprotected booleanprintRawprotected booleanprintTimeprotected booleanprintUniqueprotected inttimewindowprotected intunsavedLineCountprotected booleanwriteHeaderprotected Writerwriter
-
Constructor Summary
Constructors Constructor Description ParameterFormatter(Writer writer, Collection<org.yamcs.protobuf.Yamcs.NamedObjectId> paramList)ParameterFormatter(Writer writer, Collection<org.yamcs.protobuf.Yamcs.NamedObjectId> paramList, char columnSeparator)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()voidflush()intgetLinesReceived()intgetLinesSaved()voidresetTimeWindow()voidsetAllParametersPresent(boolean allParametersPresent)voidsetKeepValues(boolean keepValues)voidsetPrintMonitoring(boolean printMonitoring)voidsetPrintRaw(boolean printRaw)voidsetPrintTime(boolean printTime)voidsetPrintUnique(boolean printUnique)voidsetTimeWindow(int timewindow)voidsetWriteHeader(boolean writeHeader)voidupdateWriter(OutputStream outputStream, Charset charset)protected voidwriteParameters()voidwriteParameters(List<ParameterValueWithId> params)adds new parameters - if they are written to the output buffer or not depends on the settings
-
-
-
Field Detail
-
writer
protected Writer writer
-
printTime
protected boolean printTime
-
printRaw
protected boolean printRaw
-
printMonitoring
protected boolean printMonitoring
-
printUnique
protected boolean printUnique
-
keepValues
protected boolean keepValues
-
writeHeader
protected boolean writeHeader
-
allParametersPresent
protected boolean allParametersPresent
-
timewindow
protected int timewindow
-
unsavedLineCount
protected int unsavedLineCount
-
linesSaved
protected int linesSaved
-
linesReceived
protected int linesReceived
-
first
protected boolean first
-
-
Constructor Detail
-
ParameterFormatter
public ParameterFormatter(Writer writer, Collection<org.yamcs.protobuf.Yamcs.NamedObjectId> paramList)
-
ParameterFormatter
public ParameterFormatter(Writer writer, Collection<org.yamcs.protobuf.Yamcs.NamedObjectId> paramList, char columnSeparator)
-
-
Method Detail
-
updateWriter
public void updateWriter(OutputStream outputStream, Charset charset)
-
setPrintRaw
public void setPrintRaw(boolean printRaw)
-
setPrintMonitoring
public void setPrintMonitoring(boolean printMonitoring)
-
setPrintTime
public void setPrintTime(boolean printTime)
-
setPrintUnique
public void setPrintUnique(boolean printUnique)
-
setWriteHeader
public void setWriteHeader(boolean writeHeader)
-
setAllParametersPresent
public void setAllParametersPresent(boolean allParametersPresent)
-
setKeepValues
public void setKeepValues(boolean keepValues)
-
setTimeWindow
public void setTimeWindow(int timewindow)
-
resetTimeWindow
public void resetTimeWindow()
-
writeParameters
public void writeParameters(List<ParameterValueWithId> params) throws IOException
adds new parameters - if they are written to the output buffer or not depends on the settings- Parameters:
params-- Throws:
IOException
-
writeParameters
protected void writeParameters() throws IOException- Throws:
IOException
-
flush
public void flush()
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
getLinesSaved
public int getLinesSaved()
-
getLinesReceived
public int getLinesReceived()
-
-