|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.bbn.openmap.layer.vpf.DcwColumnInfo
public class DcwColumnInfo
Encapsulate the information about a particular column in a vpf table. This class can read both VPF V1 (MIL-STD-600006, dated 1992) and VPF V2 (MIL-STD-2407, dated 1996, supercedes V1)
Field Summary | |
---|---|
static char |
VPF_COLUMN_DATE
|
static char |
VPF_COLUMN_DOUBLE
|
static char |
VPF_COLUMN_DOUBLE_2COORD
|
static char |
VPF_COLUMN_DOUBLE_3COORD
|
static char |
VPF_COLUMN_FLOAT
|
static char |
VPF_COLUMN_FLOAT_2COORD
|
static char |
VPF_COLUMN_FLOAT_3COORD
|
static char |
VPF_COLUMN_FOREIGN_KEY
|
static char |
VPF_COLUMN_INT
|
static char |
VPF_COLUMN_INT_OR_SHORT
VPF Column Type Constant for a column that can be either int or short. |
static char |
VPF_COLUMN_NON_KEY
|
static char |
VPF_COLUMN_NULL
|
static char |
VPF_COLUMN_PRIMARY_KEY
VPF Column Key Type Constants |
static char |
VPF_COLUMN_SHORT
|
static char |
VPF_COLUMN_TEXT
VPF Column Type Constants |
static char |
VPF_COLUMN_TEXTL1
|
static char |
VPF_COLUMN_TEXTL2
|
static char |
VPF_COLUMN_TEXTL3
|
static char |
VPF_COLUMN_TRIPLET
|
Constructor Summary | |
---|---|
DcwColumnInfo(BinaryFile inputFile)
Construct a DcwColumnInfo from the specified input stream. |
Method Summary | |
---|---|
void |
assertSchema(char type,
int length,
boolean strictlength)
Claim that the column has a particular schema |
int |
fieldLength()
the number of bytes a field of this type takes in the input file |
java.lang.String |
getColumnDescription()
Get the column description |
java.lang.String |
getColumnName()
get the name of the column |
char |
getFieldType()
get the VPF datatype of the column |
char |
getKeyType()
get the VPF key type (one of VPF_COLUMN_PRIMARY_KEY, VPF_COLUMN_FOREIGN_KEY, or VPF_COLUMN_NON_KEY) |
java.lang.String |
getNarrativeTable()
get the name of the narrative table |
int |
getNumberOfElements()
get the number of elements |
java.lang.String |
getThematicIndexName()
get the name of the thematic index |
java.lang.String |
getValueDescriptionTable()
Get the name of the value description table |
java.lang.String |
getVDT()
Get the name of the value description table |
boolean |
isForeignKey()
Return true if this column is a foreign key. |
boolean |
isNonKey()
Return true if this column is not a key column. |
boolean |
isPrimaryKey()
Return true if this column is a primary key. |
java.lang.Object |
parseField(BinaryFile inputFile)
Read an element of the type specified by the column |
java.lang.String |
toString()
produce a nice printed version of all our contained information |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final char VPF_COLUMN_TEXT
public static final char VPF_COLUMN_TEXTL1
public static final char VPF_COLUMN_TEXTL2
public static final char VPF_COLUMN_TEXTL3
public static final char VPF_COLUMN_FLOAT
public static final char VPF_COLUMN_DOUBLE
public static final char VPF_COLUMN_SHORT
public static final char VPF_COLUMN_INT
public static final char VPF_COLUMN_FLOAT_2COORD
public static final char VPF_COLUMN_DOUBLE_2COORD
public static final char VPF_COLUMN_FLOAT_3COORD
public static final char VPF_COLUMN_DOUBLE_3COORD
public static final char VPF_COLUMN_DATE
public static final char VPF_COLUMN_NULL
public static final char VPF_COLUMN_TRIPLET
public static final char VPF_COLUMN_INT_OR_SHORT
public static final char VPF_COLUMN_PRIMARY_KEY
public static final char VPF_COLUMN_FOREIGN_KEY
public static final char VPF_COLUMN_NON_KEY
Constructor Detail |
---|
public DcwColumnInfo(BinaryFile inputFile) throws java.io.EOFException, FormatException
inputFile
- the filestream to construct from
java.io.EOFException
- when the first character read is a ';',
indicating that we've reached the end of the column
list; also thrown for an end of file
FormatException
- some error was detected while
reading the info for the column.Method Detail |
---|
public void assertSchema(char type, int length, boolean strictlength) throws FormatException
type
- the FieldType (datatype) this column is expected to
contain legal values are specified by the VPF standard.
the non-standard value 'i' is also accepted (equivalent
to 'I' or 'S'), indicating an integral type.length
- the number of elements in this columnstrictlength
- false means that variable length columns
can be fixed length instead
FormatException
- the column is not of the particular
type/lengthpublic int fieldLength() throws FormatException
FormatException
- the FieldType of this Column is not
a valid VPF fieldtypepublic java.lang.String getColumnName()
public char getFieldType()
public int getNumberOfElements()
public char getKeyType()
public boolean isPrimaryKey()
true
if this column is a primary key. For
any valid column, exactly one of isPrimaryKey, isForeignKey and
isNonKey will be true
.
isForeignKey()
,
isNonKey()
public boolean isForeignKey()
true
if this column is a foreign key. For
any valid column, exactly one of isPrimaryKey, isForeignKey and
isNonKey will be true
.
isPrimaryKey()
,
isNonKey()
public boolean isNonKey()
true
if this column is not a key column.
For any valid column, exactly one of isPrimaryKey, isForeignKey
and isNonKey will be true
.
isForeignKey()
,
isPrimaryKey()
public java.lang.String getColumnDescription()
null
)public java.lang.String getValueDescriptionTable()
null
). The same as getVDT()getVDT()
public java.lang.String getVDT()
null
). The same as
getValueDescriptionTablegetValueDescriptionTable()
public java.lang.String getThematicIndexName()
null
)public java.lang.String getNarrativeTable()
null
)public java.lang.Object parseField(BinaryFile inputFile) throws java.io.EOFException, FormatException
java.io.EOFException
- an end-of-file was encountered before
reading any of the field
FormatException
- some data-consistency check failed
while reading the data, or an end-of-file condition
popped up in the middle of reading a field (partial
read)public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |