public class SDDSParameter
extends java.lang.Object
Constructor and Description |
---|
SDDSParameter()
Create a new SDDS parameter that can be used to store parameter information for SDDS files.
|
Modifier and Type | Method and Description |
---|---|
boolean |
deletePage(int page)
Delete a page at the specified index
|
java.lang.String |
getDescription()
Returns the description of the parameter
|
java.lang.String |
getFixed_Value()
Returns the fixed value of the parameter
|
java.lang.String |
getFormat_String()
Returns the format string of the parameter
|
java.lang.String |
getName()
Returns the name of the parameter
|
int |
getPageCount()
Returns the number of pages that the parameter contains
|
java.lang.String |
getSymbol()
Returns the symbol of the parameter
|
int |
getType()
Returns the type of the parameter
|
java.lang.String |
getUnits()
Returns the units of the parameter
|
java.lang.Object |
getValue(int page,
boolean string_quotes)
Get the values of the parameter for a chosen page
|
boolean |
insertPage(int page)
Inserts a blank page at the specified index
|
void |
makeBlankPages(int lastpage)
Create blank pages up to the last page specified
|
void |
setDescription(java.lang.String description)
Set the parameter description
|
void |
setFixed_Value(java.lang.String fixed_value)
Set the fixed value of the parameter
|
void |
setFormat_String(java.lang.String format_string)
Set the parameter format string
|
void |
setName(java.lang.String name)
Set the parameter name
|
void |
setSymbol(java.lang.String symbol)
Set the parameter symbol
|
void |
setUnits(java.lang.String units)
Set the parameter units
|
void |
setupParameter(java.lang.String name,
java.lang.String symbol,
java.lang.String units,
java.lang.String description,
java.lang.String format_string,
int type,
java.lang.String fixed_value)
Set up the parameter information.
|
void |
setValue(double value,
int page)
Set the value of the parameter at a chosen page
|
void |
setValue(long value,
int page)
Set the value of the parameter at a chosen page
|
void |
setValue(java.lang.String value,
int page)
Set the value of the parameter at a chosen page
|
boolean |
writeHeader(java.io.DataOutputStream dos)
Write the header to a file.
|
boolean |
writeValue(java.io.DataOutputStream dos,
int page,
boolean ascii)
Write the value of the parameter for a chosen page
|
boolean |
writeValue(LEDataOutputStream ledos,
int page)
Write the little endian binary value of the parameter for a chosen page
|
public SDDSParameter()
public void setupParameter(java.lang.String name, java.lang.String symbol, java.lang.String units, java.lang.String description, java.lang.String format_string, int type, java.lang.String fixed_value)
name
- should be a valid name as defined by
SDDSUtil.isValidNamesymbol
- may be null
units
- may be null
description
- may be null
format_string
- may be null
type
- valid values are:
1
for double2
for float3
for long4
for ulong5
for short6
for ushort7
for string8
for characterfixed_value
- may be null
public java.lang.String getName()
String
value of the parameter name.public void setName(java.lang.String name)
name
- name of the parameterpublic java.lang.String getSymbol()
String
value of the parameter symbol.public void setSymbol(java.lang.String symbol)
symbol
- symbol of the parameterpublic java.lang.String getUnits()
String
value of the parameter units.public void setUnits(java.lang.String units)
units
- units of the parameterpublic java.lang.String getDescription()
String
value of the parameter description.public void setDescription(java.lang.String description)
description
- description of the parameterpublic java.lang.String getFormat_String()
String
value of the parameter format string.public void setFormat_String(java.lang.String format_string)
format_string
- format string of the parameterpublic int getType()
int
value of the parameter type.public java.lang.String getFixed_Value()
String
value of the parameter fixed value.public void setFixed_Value(java.lang.String fixed_value)
fixed_value
- fixed_value of the parameterpublic int getPageCount()
int
value of the number of pages the parameter contains.public boolean insertPage(int page)
page
- index of page to create inserttrue
on successfalse
on error.public boolean deletePage(int page)
page
- index of page to deletetrue
on successfalse
on error.public void makeBlankPages(int lastpage)
lastpage
- last page to create blank pagepublic void setValue(long value, int page)
value
- a long precision numberpage
- the page of the parameter, must be greater then 0
public void setValue(double value, int page)
value
- a double precision floating-point numberpage
- the page of the parameter, must be greater then 0
public void setValue(java.lang.String value, int page)
value
- a string valuepage
- the page of the parameter, must be greater then 0
public boolean writeHeader(java.io.DataOutputStream dos)
dos
- a valid DataOutputStreamtrue
if the header was successfully writtenfalse
if an error occuredpublic boolean writeValue(java.io.DataOutputStream dos, int page, boolean ascii)
dos
- a valid DataOutputStreampage
- the page of the parameter, must be greater then 0
ascii
- set true
to write ascii parameters,
false
to write big endian binary parameterstrue
if the value was successfully writtenfalse
if an invalid page was encountered or if
the parameter type is undefined.public boolean writeValue(LEDataOutputStream ledos, int page)
ledos
- a valid LEDataOutputStreampage
- the page of the parameter, must be greater then 0
true
if the value was successfully writtenfalse
if an invalid page was encountered or if
the parameter type is undefined.public java.lang.Object getValue(int page, boolean string_quotes)
page
- the page of the parameter, must be greater then 0
string_quotes
- true
if quotes are to be added around stringsfalse
if raw strings are to be outputed.