public class SDDSColumn
extends java.lang.Object
Constructor and Description |
---|
SDDSColumn()
Create a new SDDS column that can be used to store column information for SDDS files.
|
Modifier and Type | Method and Description |
---|---|
boolean |
deletePage(int page)
Delete a page at the specified index
|
void |
deleteRow(int page,
int row)
Deletes the value of the column at a chosen page and at a chosen row
|
java.lang.String |
getDescription()
Returns the description of the column
|
int |
getField_Length()
Returns the field length of the column
|
java.lang.String |
getFormat_String()
Returns the format string of the column
|
java.lang.String |
getName()
Returns the name of the column
|
int |
getPageCount()
Returns the number of pages that the column contains
|
int |
getRowCount(int page)
Returns the number of rows a page contains
|
java.lang.String |
getSymbol()
Returns the symbol of the column
|
int |
getType()
Returns the type of the column
|
java.lang.String |
getUnits()
Returns the units of the column
|
java.lang.Object[] |
getValues(int page,
boolean string_quotes)
Get the values of the column 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 description of the column
|
void |
setField_Length(int field_length)
Set the field length of the column
|
void |
setFormat_String(java.lang.String format_string)
Set the format string of the column
|
void |
setName(java.lang.String name)
Set the name of the column
|
void |
setSymbol(java.lang.String symbol)
Set the symbol of the column
|
void |
setUnits(java.lang.String units)
Set the units of the column
|
void |
setupColumn(java.lang.String name,
java.lang.String symbol,
java.lang.String units,
java.lang.String description,
java.lang.String format_string,
int type,
int field_length)
Set up the column information.
|
void |
setValues(double[] v,
int page,
int startRow)
Set the values of the column at a chosen page starting at the chosen row
|
void |
setValues(long[] v,
int page,
int startRow)
Set the values of the column at a chosen page starting at the chosen row
|
void |
setValues(java.lang.String[] v,
int page,
int startRow)
Set the values of the column at a chosen page starting at the chosen row
|
boolean |
writeColumn(java.io.DataOutputStream dos,
int page)
Write the values of the column for a chosen page
|
boolean |
writeElement(java.io.DataOutputStream dos,
int page,
int row,
boolean ascii)
Write the value of the column for a chosen page and row
|
boolean |
writeElement(LEDataOutputStream ledos,
int page,
int row)
Write the little endian binary value of the column for a chosen page and row
|
boolean |
writeHeader(java.io.DataOutputStream dos)
Write the header to a file.
|
public SDDSColumn()
public void setupColumn(java.lang.String name, java.lang.String symbol, java.lang.String units, java.lang.String description, java.lang.String format_string, int type, int field_length)
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 characterfield_length
- has no effect currentlypublic java.lang.String getName()
String
value of the column name.public void setName(java.lang.String name)
name
- name of the columnpublic java.lang.String getSymbol()
String
value of the column symbol.public void setSymbol(java.lang.String symbol)
symbol
- symbol of the columnpublic java.lang.String getUnits()
String
value of the column units.public void setUnits(java.lang.String units)
units
- units of the columnpublic java.lang.String getDescription()
String
value of the column description.public void setDescription(java.lang.String description)
description
- description of the columnpublic java.lang.String getFormat_String()
String
value of the column format string.public void setFormat_String(java.lang.String format_string)
format_string
- format string of the columnpublic int getType()
int
value of the column type.public int getField_Length()
int
value of the column field length.public void setField_Length(int field_length)
field_length
- field length of the columnpublic int getPageCount()
int
value of the number of pages the column contains.public int getRowCount(int page)
int
value of the number of pages the column contains.-1
if the page value is invalid.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 deleteRow(int page, int row)
page
- the page of the column, must be greater then 0
row
- the row of the column, must be greater then 0
public void setValues(long[] v, int page, int startRow)
v
- a long precision number arraypage
- the page of the column, must be greater then 0
startRow
- the row of the column, must be greater then 0
public void setValues(double[] v, int page, int startRow)
v
- a double precision floating-point number arraypage
- the page of the column, must be greater then 0
startRow
- the row of the column, must be greater then 0
public void setValues(java.lang.String[] v, int page, int startRow)
v
- a string value arraypage
- the page of the column, must be greater then 0
startRow
- the row of the column, 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 writeElement(java.io.DataOutputStream dos, int page, int row, boolean ascii)
dos
- a valid DataOutputStreampage
- the page of the column, must be greater then 0
row
- the row of the column, must be greater then 0
ascii
- set true
to write ascii column data,
false
to write big endian binary column datatrue
if the value was successfully writtenfalse
if an invalid page or row was encountered or if
the column type is undefined.public boolean writeElement(LEDataOutputStream ledos, int page, int row)
ledos
- a valid LEDataOutputStreampage
- the page of the column, must be greater then 0
row
- the row of the column, must be greater then 0
true
if the value was successfully writtenfalse
if an invalid page or row was encountered or if
the column type is undefined.public boolean writeColumn(java.io.DataOutputStream dos, int page)
dos
- a valid DataOutputStreampage
- the page of the column, must be greater then 0
true
if the values were successfully writtenfalse
if an invalid page was encountered or if
the column type is undefined.public java.lang.Object[] getValues(int page, boolean string_quotes)
page
- the page of the column, must be greater then 0
string_quotes
- true
if quotes are to be added around stringsfalse
if raw strings are to be outputed.