public class MdfHelper
extends java.lang.Object
| Constructor and Description |
|---|
MdfHelper() |
| Modifier and Type | Method and Description |
|---|---|
boolean[] |
ccValToBooleanArray(java.util.List<java.lang.String> list)
Parse the keys of a lookup table as boolean values
|
byte[] |
ccValToByteArray(java.util.List<java.lang.String> list)
Parse the keys of a lookup table as byte values
|
int[] |
ccValToLongArray(java.util.List<java.lang.String> ccVal)
Parse the keys of a lookup table as long values
|
T_LONGLONG[] |
ccValToLongLongArray(java.util.List<java.lang.String> ccVal)
Parse the keys of a lookup table as T_LONGLONG values
|
short[] |
ccValToShortArray(java.util.List<java.lang.String> ccVal)
Parse the keys of a lookup table as short values
|
int |
checkAndConvertOdsTypespecToSignedDataType(int odsTypespec,
int bitCount)
This method checks if the passed ods typespec is unsigned and the passed bit count is less enough,
so the typespec is changed to signed typespec.
|
NameValueUnit |
createInvalidAttribute(java.lang.String name,
DataType dt)
Create a NameValueUnit for an invalid attribute
|
int |
getCorrespondingLeoValueType(int typeSpecEnumValue)
Returns the corresponding LEO typespec enum value for the passed BEO value.
|
static MdfHelper |
getInstance() |
long |
getMaxChannelId(com.highqsoft.mdf410.xsd.CgBlock cgBlock)
Find the highest used channel id within a channel group
|
int |
getRecIdSizeInBytes(com.highqsoft.mdf410.xsd.RECORDIDTYPE dgRecIdSize)
Converts the recordIdType to the number of bytes used by the record id
|
int |
getTypeSpecEnumLengthInBytes(int typeSpecEnumValue,
long bitCount)
This methods return the length in bytes of the given TypeSpecEnumValue.
|
boolean |
isBeoValueType(int typeSpecEnumValue)
Return true, if the passed TypeSpec Enumvalue if a Big Endian Organized data type.
|
boolean |
isBitIsSet(byte value,
int bit)
Check if a specific Bit in a byte value is set
|
boolean |
isBitIsSet(int value,
int bit)
Check if a specific Bit in an integer value is set
|
boolean |
isBitIsSet(long value,
int bit)
Check if a specific Bit in an long value is set
|
boolean |
isUnsignedValueType(int typeSpecEnumValue)
Return true, if the passed TypeSpec Enumvalue if a Big Endian Organized data type.
|
boolean |
isVlsdValueType(int typeSpecEnumValue)
Return true, if the passed TypeSpec Enumvalue has variable length data data.
|
DataType |
mapMdf4DatatypeToOdsDatatype(com.highqsoft.mdf410.xsd.CnBlock cnBlock)
Convert the mdf datatypes to ODS datatypes
The MDF types are made of a datatype and a number of bits.
|
int |
mapMdf4DatatypeToOdsTypespec(com.highqsoft.mdf410.xsd.CnBlock cnBlock)
Convert the mdf datatypes to an ODS typespec used in external components
The MDF types are made of a datatype and a number of bits.
|
java.lang.String |
parseMdf4CgMdComment(java.lang.String comment)
The comment used for the LC desctiption contains a structure, so we have to
parse the interesting part from the original comment.
|
java.lang.String |
parseMdf4CnMdComment(java.lang.String comment)
The comment used for the Meq desctiption contains a structure, so we have to
parse the interesting part from the original comment.
|
java.lang.String |
parseUnit(java.lang.String cnUnit)
Parse the unit from the CDATA section
|
byte |
setBit(byte value,
int bitNumber,
int valueToSet)
Sets a bit to the passed value in the given byte
|
byte |
setBitRange(byte value,
int bitNumberStart,
int bitNumberEnd,
int valueToSet)
Sets a range of bits in the given byte to the passed value
|
byte[] |
uncompressZipBlock(byte[] compressedData,
long zipParameter) |
public static MdfHelper getInstance()
public NameValueUnit createInvalidAttribute(java.lang.String name, DataType dt)
name - The name of the attributedt - The data type of the attributepublic int getRecIdSizeInBytes(com.highqsoft.mdf410.xsd.RECORDIDTYPE dgRecIdSize)
dgRecIdSize - The Record Id Typepublic boolean isBitIsSet(byte value,
int bit)
value - The integer value to checkbit - The bit number (rightmost bit is 0)public boolean isBitIsSet(int value,
int bit)
value - The integer value to checkbit - The bit number (rightmost bit is 0)public boolean isBitIsSet(long value,
int bit)
value - The long value to checkbit - The bit number (rightmost bit is 0)public byte setBit(byte value,
int bitNumber,
int valueToSet)
value - byte in which the bit should be setbitNumber - number of the bit to setvalueToSet - 0 or 1public byte setBitRange(byte value,
int bitNumberStart,
int bitNumberEnd,
int valueToSet)
value - byte in which the bit should be setbitNumberStart - the first postion to changebitNumberEnd - the last postion to changepublic long getMaxChannelId(com.highqsoft.mdf410.xsd.CgBlock cgBlock)
cgBlock - The CgBlockpublic java.lang.String parseUnit(java.lang.String cnUnit)
cnUnit - The CDATA section containing the unit in square bracespublic boolean[] ccValToBooleanArray(java.util.List<java.lang.String> list)
throws java.lang.NumberFormatException
list - String list containing the keysjava.lang.NumberFormatExceptionpublic byte[] ccValToByteArray(java.util.List<java.lang.String> list)
throws java.lang.NumberFormatException
list - String list containing the keysjava.lang.NumberFormatExceptionpublic short[] ccValToShortArray(java.util.List<java.lang.String> ccVal)
throws java.lang.NumberFormatException
list - String list containing the keysjava.lang.NumberFormatExceptionpublic int[] ccValToLongArray(java.util.List<java.lang.String> ccVal)
throws java.lang.NumberFormatException
list - String list containing the keysjava.lang.NumberFormatExceptionpublic T_LONGLONG[] ccValToLongLongArray(java.util.List<java.lang.String> ccVal) throws java.lang.NumberFormatException
list - String list containing the keysjava.lang.NumberFormatExceptionpublic java.lang.String parseMdf4CnMdComment(java.lang.String comment)
comment - The comment as it comes from the Mdf filepublic java.lang.String parseMdf4CgMdComment(java.lang.String comment)
comment - The comment as it comes from the Mdf filepublic int mapMdf4DatatypeToOdsTypespec(com.highqsoft.mdf410.xsd.CnBlock cnBlock)
throws InvalidArgumentException
cnBlock - The channelBlock. Contains mdf datatype and number of bits usedInvalidArgumentExceptionpublic int checkAndConvertOdsTypespecToSignedDataType(int odsTypespec,
int bitCount)
odsTypespec, - the current ods typespecbitCount, - the number of bits which use the current data typepublic DataType mapMdf4DatatypeToOdsDatatype(com.highqsoft.mdf410.xsd.CnBlock cnBlock) throws InvalidArgumentException
cnBlock - The channelBlock. Contains mdf datatype and number of bits usedInvalidArgumentExceptionpublic int getTypeSpecEnumLengthInBytes(int typeSpecEnumValue,
long bitCount)
typeSpecEnumValue - public boolean isBeoValueType(int typeSpecEnumValue)
public boolean isUnsignedValueType(int typeSpecEnumValue)
public int getCorrespondingLeoValueType(int typeSpecEnumValue)
public boolean isVlsdValueType(int typeSpecEnumValue)
public byte[] uncompressZipBlock(byte[] compressedData,
long zipParameter)