public class UBH extends FwkFileFilter implements UBHInterface, FwkReadColumnsFromStreamInterface
Property Keyword | Datatype | Default | Description |
---|---|---|---|
UBH.Text.Description | classname | (*.ub) | File type description. |
,
Serialized FormModifier and Type | Field and Description |
---|---|
protected BinaryFormat |
binaryFormat |
protected int |
blockCount |
protected int |
blocking |
static java.lang.String |
C_DATATYPE_UNKNOWN |
static java.lang.String |
C_DATATYPENAME |
static java.lang.String[] |
C_DATATYPES |
protected FwkColumnAccessInterface[] |
columns |
static java.lang.String |
COMMENT |
protected java.lang.String |
dataFile |
static java.lang.String |
DATATYPE |
static int |
DT_CHAR |
static int |
DT_DOUBLE |
static int |
DT_FLOAT |
static int |
DT_INT |
static int |
DT_LONG |
static int |
DT_SHORT |
static int |
DT_UCHAR |
static int |
DT_UINT |
static int |
DT_ULONG |
static int |
DT_USHORT |
protected java.lang.String |
name |
protected java.lang.String |
path |
protected FwkPropertyGroupInterface |
propertyGroup |
protected int |
sectionSize |
protected int |
signalCount |
protected long[] |
signalOffset |
protected SignalInterface[] |
signals |
protected java.lang.String |
ubhFile |
version
Constructor and Description |
---|
UBH() |
UBH(java.lang.String spec)
The constructor receiving the file or URL specification of a file
containing the Univeral Binary Header.
|
Modifier and Type | Method and Description |
---|---|
boolean |
accept(java.io.File f)
Return true if file is accepted.
|
protected void |
createDefaultPropertySet(java.lang.String spec,
int numSignals)
Set the default properties.
|
BinaryFormatInterface |
getBinaryFormat()
The binary format description.
|
int |
getBlockCount()
Block count.
|
int |
getBlocking()
Blocking, 1=channel multiplexed, e.g. 512=blockmultiplexed.
|
long |
getBlockOffset(int signal,
int datatype,
int index)
Get the byte offset of the block of the value belong to the given signal and index.
|
FwkColumnAccessInterface |
getColumn(int no)
Get columns.
|
FwkColumnAccessInterface[] |
getColumns()
Get columns.
|
int |
getCountPerSignal()
Get the total number of values per signal.
|
java.lang.String |
getCreatedOnPlatform()
Get the platform that created the data.
|
int |
getDebugLevel()
The debug level.
|
java.lang.String |
getDescription()
The description of this filter.
|
long |
getOffset(int signal,
int datatype,
int index)
Get the byte offset of the value belong to the given signal and index.
|
SignalInterface |
getSignal(int no)
Get a signal.
|
int |
getSignalCount()
get the signal count.
|
static int |
getValueByteCount(int dataType)
Get the total number of bytes need in file for one value.
|
java.lang.String |
getVersion()
The revision number.
|
static void |
main(java.lang.String[] args)
Main module of this application.
|
FwkPropertyGroupInterface |
read(java.io.InputStream is)
Read the header file.
|
FwkColumnAccessInterface[] |
read(java.lang.String spec,
java.io.InputStream unused)
Read columns from stream.
|
protected void |
readHeader(java.lang.String spec)
Read the header from file.
|
void |
release()
Release the header.
|
java.lang.String |
toString()
Print out the string presentation of the class.
|
accept, addExtension, getExtension, isExtensionListInDescription, setDescription, setExtensionListInDescription, setPattern
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
accept
public static final java.lang.String[] C_DATATYPES
public static final int DT_USHORT
public static final int DT_SHORT
public static final int DT_UCHAR
public static final int DT_CHAR
public static final int DT_INT
public static final int DT_UINT
public static final int DT_LONG
public static final int DT_ULONG
public static final int DT_FLOAT
public static final int DT_DOUBLE
public static final java.lang.String COMMENT
public static final java.lang.String C_DATATYPENAME
public static final java.lang.String DATATYPE
public static final java.lang.String C_DATATYPE_UNKNOWN
protected FwkPropertyGroupInterface propertyGroup
protected BinaryFormat binaryFormat
protected SignalInterface[] signals
protected FwkColumnAccessInterface[] columns
protected long[] signalOffset
protected int signalCount
protected java.lang.String dataFile
protected java.lang.String ubhFile
protected java.lang.String path
protected java.lang.String name
protected int blocking
protected int blockCount
protected int sectionSize
public UBH()
public UBH(java.lang.String spec) throws java.io.IOException, java.io.FileNotFoundException
spec
- the resource location of the header.java.io.IOException
java.io.FileNotFoundException
protected void readHeader(java.lang.String spec) throws java.io.IOException, java.io.FileNotFoundException
sepc
- the file specification.java.io.IOException
java.io.FileNotFoundException
protected void createDefaultPropertySet(java.lang.String spec, int numSignals)
public void release()
release
in interface FwkInterface
public boolean accept(java.io.File f)
accept
in interface FwkFileFilterInterface
accept
in class FwkFileFilter
f
- The file to be checked.FwkFileFilter.getExtension(java.io.File)
,
FileFilter#accepts
public java.lang.String getDescription()
getDescription
in interface FwkFileFilterInterface
getDescription
in class FwkFileFilter
setDescription
,
setExtensionListInDescription
,
isExtensionListInDescription
,
FileFilter.getDescription()
public long getOffset(int signal, int datatype, int index)
getOffset
in interface UBHInterface
signal
- the signal number.datatype
- the signal data type.index
- The index of the requested value.public long getBlockOffset(int signal, int datatype, int index)
getBlockOffset
in interface UBHInterface
signal
- the signal number.datatype
- the signal data type.index
- The index of the requested value.public static int getValueByteCount(int dataType)
public java.lang.String getVersion()
getVersion
in interface FwkInterface
getVersion
in class FwkFileFilter
public int getDebugLevel()
getDebugLevel
in interface UBHInterface
public BinaryFormatInterface getBinaryFormat()
getBinaryFormat
in interface UBHInterface
public int getSignalCount()
getSignalCount
in interface UBHInterface
public SignalInterface getSignal(int no)
getSignal
in interface UBHInterface
no
- the number of the signal (starts at 0).public java.lang.String toString()
toString
in class java.lang.Object
public FwkColumnAccessInterface getColumn(int no)
getColumn
in interface UBHInterface
public java.lang.String getCreatedOnPlatform()
getCreatedOnPlatform
in interface UBHInterface
public FwkColumnAccessInterface[] getColumns()
getColumns
in interface UBHInterface
public FwkColumnAccessInterface[] read(java.lang.String spec, java.io.InputStream unused) throws java.lang.RuntimeException
read
in interface FwkReadColumnsFromStreamInterface
is
- The input stream from that the column should be read.an
- exception when ever a problem occurs.java.lang.RuntimeException
public int getBlocking()
getBlocking
in interface UBHInterface
public int getBlockCount()
getBlockCount
in interface UBHInterface
public int getCountPerSignal()
getCountPerSignal
in interface UBHInterface
public FwkPropertyGroupInterface read(java.io.InputStream is) throws java.io.IOException
is
- the input stream.java.io.IOException
public static void main(java.lang.String[] args)