public class DDFSubfieldDefinition extends java.lang.Object implements DDFConstants
Modifier and Type | Class and Description |
---|---|
static interface |
DDFSubfieldDefinition.DDFBinaryFormat |
Modifier and Type | Field and Description |
---|---|
protected boolean |
bIsVariable
bIsVariable determines whether we using the chFormatDelimeter (true), or
the fixed width (false).
|
protected char |
chFormatDelimeter |
protected int |
eBinaryFormat |
protected DDFDataType |
eType |
protected int |
nFormatWidth |
protected java.lang.String |
pszFormatString |
protected java.lang.String |
pszName |
DDF_FIELD_TERMINATOR, DDF_LEADER_SIZE, DDF_UNIT_TERMINATOR
Constructor and Description |
---|
DDFSubfieldDefinition() |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
dumpData(byte[] pachData,
int nMaxBytes)
Dump subfield value to debugging file.
|
double |
extractFloatData(byte[] pachSourceData,
int nMaxBytes,
MutableInt pnConsumedBytes)
Extract a subfield value as a float.
|
int |
extractIntData(byte[] pachSourceData,
int nMaxBytes,
MutableInt pnConsumedBytes)
Extract a subfield value as an integer.
|
int |
getDataLength(byte[] pachSourceData,
int nMaxBytes,
MutableInt pnConsumedBytes)
Scan for the end of variable length data.
|
java.lang.String |
getFormat()
Get pointer to subfield format string
|
java.lang.String |
getName()
Get pointer to subfield name.
|
DDFDataType |
getType()
Get the general type of the subfield.
|
int |
getWidth() |
boolean |
setFormat(java.lang.String pszFormat)
While interpreting the format string we don't support:
Passing an explicit terminator for variable length field.
|
void |
setName(java.lang.String pszNewName)
Set the name of the subfield.
|
java.lang.String |
toString()
Write out subfield definition info.
|
protected java.lang.String pszName
protected java.lang.String pszFormatString
protected DDFDataType eType
protected int eBinaryFormat
protected boolean bIsVariable
protected char chFormatDelimeter
protected int nFormatWidth
public int getWidth()
public java.lang.String getName()
public java.lang.String getFormat()
public DDFDataType getType()
public void setName(java.lang.String pszNewName)
public boolean setFormat(java.lang.String pszFormat)
public java.lang.String toString()
toString
in class java.lang.Object
public int getDataLength(byte[] pachSourceData, int nMaxBytes, MutableInt pnConsumedBytes)
This method is mainly for internal use, or for applications which want the raw binary data to interpret themselves. Otherwise use one of ExtractStringData(), ExtractIntData() or ExtractFloatData().
pachSourceData
- The pointer to the raw data for this field. This may have come
from DDFRecord::GetData(), taking into account skip factors
over previous subfields data.nMaxBytes
- The maximum number of bytes that are accessible after
pachSourceData.pnConsumedBytes
- the number of bytes used.public double extractFloatData(byte[] pachSourceData, int nMaxBytes, MutableInt pnConsumedBytes)
pachSourceData
- The pointer to the raw data for this field. This may have come
from DDFRecord::GetData(), taking into account skip factors
over previous subfields data.nMaxBytes
- The maximum number of bytes that are accessible after
pachSourceData.pnConsumedBytes
- Pointer to an integer into which the number of bytes consumed
by this field should be written. May be null to ignore. This
is used as a skip factor to increment pachSourceData to point
to the next subfields data.public int extractIntData(byte[] pachSourceData, int nMaxBytes, MutableInt pnConsumedBytes)
pachSourceData
- The pointer to the raw data for this field. This may have come
from DDFRecord::GetData(), taking into account skip factors
over previous subfields data.nMaxBytes
- The maximum number of bytes that are accessible after
pachSourceData.pnConsumedBytes
- Pointer to an integer into which the number of bytes consumed
by this field should be written. May be null to ignore. This
is used as a skip factor to increment pachSourceData to point
to the next subfields data.public java.lang.String dumpData(byte[] pachData, int nMaxBytes)
pachData
- Pointer to data for this subfield.nMaxBytes
- Maximum number of bytes available in pachData.Copyright (C) BBNT Solutions LLC; See http://openmap.bbn.com/ for details