public class UBH extends FwkFileFilter implements UBHInterface, FwkReadColumnsFromStreamInterface
| Property Keyword | Datatype | Default | Description |
|---|---|---|---|
| UBH.Text.Description | classname | (*.ub) | File type description. |
,
Serialized Form| Modifier 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, setPatternclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitacceptpublic 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.IOExceptionjava.io.FileNotFoundExceptionprotected void readHeader(java.lang.String spec)
throws java.io.IOException,
java.io.FileNotFoundException
sepc - the file specification.java.io.IOExceptionjava.io.FileNotFoundExceptionprotected void createDefaultPropertySet(java.lang.String spec,
int numSignals)
public void release()
release in interface FwkInterfacepublic boolean accept(java.io.File f)
accept in interface FwkFileFilterInterfaceaccept in class FwkFileFilterf - The file to be checked.FwkFileFilter.getExtension(java.io.File),
FileFilter#acceptspublic java.lang.String getDescription()
getDescription in interface FwkFileFilterInterfacegetDescription in class FwkFileFiltersetDescription,
setExtensionListInDescription,
isExtensionListInDescription,
FileFilter.getDescription()public long getOffset(int signal,
int datatype,
int index)
getOffset in interface UBHInterfacesignal - 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 UBHInterfacesignal - 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 FwkInterfacegetVersion in class FwkFileFilterpublic int getDebugLevel()
getDebugLevel in interface UBHInterfacepublic BinaryFormatInterface getBinaryFormat()
getBinaryFormat in interface UBHInterfacepublic int getSignalCount()
getSignalCount in interface UBHInterfacepublic SignalInterface getSignal(int no)
getSignal in interface UBHInterfaceno - the number of the signal (starts at 0).public java.lang.String toString()
toString in class java.lang.Objectpublic FwkColumnAccessInterface getColumn(int no)
getColumn in interface UBHInterfacepublic java.lang.String getCreatedOnPlatform()
getCreatedOnPlatform in interface UBHInterfacepublic FwkColumnAccessInterface[] getColumns()
getColumns in interface UBHInterfacepublic FwkColumnAccessInterface[] read(java.lang.String spec, java.io.InputStream unused) throws java.lang.RuntimeException
read in interface FwkReadColumnsFromStreamInterfaceis - The input stream from that the column should be read.an - exception when ever a problem occurs.java.lang.RuntimeExceptionpublic int getBlocking()
getBlocking in interface UBHInterfacepublic int getBlockCount()
getBlockCount in interface UBHInterfacepublic int getCountPerSignal()
getCountPerSignal in interface UBHInterfacepublic FwkPropertyGroupInterface read(java.io.InputStream is) throws java.io.IOException
is - the input stream.java.io.IOExceptionpublic static void main(java.lang.String[] args)