public class VPFFile extends Object
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the input stream pointed to by the object
|
int |
getAttributeCount() |
char |
getByteOrder()
Gets the value of byteOrder variable.
|
VPFColumn |
getColumn(int index) |
VPFColumn |
getColumn(String name) |
int |
getColumnCount() |
AttributeDescriptor |
getDescriptor(String name) |
String |
getDirectoryName()
Returns the directory name for this file by chopping off the file name and the separator.
|
SimpleFeatureType |
getFeatureType() |
String |
getFileName()
Returns the file name (without path) for the file
|
String |
getNarrativeTable()
Gets the value of narrativeTable variable file name.
|
String |
getPathName()
Gets the full path name for this file
|
protected int |
getRecordSize()
Method
is used to return size in bytes of records
stored in this table. |
SimpleFeature |
getRowFromId(String idName,
int id)
Returns a row with a matching value for the provided column
|
SimpleFeature |
getRowFromId0(String idName,
int id) |
String |
getTypeName() |
boolean |
hasNext()
Determines if the stream contains storage for another object.
|
boolean |
isAbstract() |
AbstractList<SimpleFeature> |
readAllRows()
Generates a list containing all of the features in the file
|
protected char |
readChar()
Reads a single byte as a character value
|
protected double |
readDouble()
Retrieves a double from the file
|
SimpleFeature |
readFeature()
Retrieves a feature from the file
|
protected Object |
readFixedSizeData(char dataType,
int instancesCount)
Retrieves a fixed amount of data from the file
|
protected float |
readFloat()
Retrieves a floating point number from the file.
|
protected Object |
readGeometry(int instancesCount,
int dimensionality,
boolean readDoubles)
Constructs an object which is an instance of Geometry by reading values from the file.
|
protected void |
readHeader()
Retrieves a number of attributes from the file header
|
protected int |
readInteger()
Retrieves an integer value from the file
|
protected byte[] |
readNumber(int cnt)
Reads some byte data from the file
|
protected short |
readShort()
Retrieves a short value from the file
|
protected String |
readString(String terminators)
Reads a string value from the file
|
protected TripletId |
readTripletId()
Retrieves a triplet object from the file
|
protected Object |
readVariableSizeData(char dataType)
Retrieves variable sized data from the file by first reading an integer which indicates how
many instances of the data type to retrieve
|
void |
reset()
Resets the file stream by setting its pointer to the first position after the header.
|
protected void |
setPosition(long pos)
Sets the position in the stream
|
String |
toString() |
protected void |
unread(long bytes)
Back up a specified number of bytes in the file stream
|
public VPFFile(String cPathName) throws IOException, SchemaException
cPathName
- The path to this fileIOException
- if the path or the file are invalidSchemaException
- if the contained feature type can not be constructedpublic SimpleFeatureType getFeatureType()
public int getAttributeCount()
public char getByteOrder()
public String getDirectoryName()
public String getFileName()
public String getNarrativeTable()
public String getPathName()
protected int getRecordSize()
getRecordSize
is used to return size in bytes of records
stored in this table. If table keeps variable length records -1
should be
returned.int
valuepublic SimpleFeature getRowFromId(String idName, int id)
idName
- The name of the column to look for, such as "id"id
- An identifier for the requested rowIllegalAttributeException
- The feature can not be created due to illegal attributes in
the source filepublic SimpleFeature getRowFromId0(String idName, int id)
public String getTypeName()
public boolean hasNext()
boolean
public boolean isAbstract()
public AbstractList<SimpleFeature> readAllRows() throws IOException
List
value containing Feature objectsIOException
- if an error occursprotected char readChar() throws IOException
char
valueIOException
- if an error occursprotected Object readGeometry(int instancesCount, int dimensionality, boolean readDoubles) throws IOException
instancesCount
- number of coordinates to readdimensionality
- either 2 or 3readDoubles
- true: read a double value; false: read a float valueIOException
- on any file IO errorsprotected double readDouble() throws IOException
double
valueIOException
- if an error occurspublic SimpleFeature readFeature() throws IOException, IllegalAttributeException
IOException
- on any file IO errorsIllegalAttributeException
- if any of the attributes retrieved are illegalprotected Object readFixedSizeData(char dataType, int instancesCount) throws IOException
dataType
- a char
value indicating the data typeinstancesCount
- an int
value indicating the number of instances to
retrieve.Object
valueIOException
- if an error occursprotected float readFloat() throws IOException
float
valueIOException
- if an error occursprotected void readHeader() throws VPFHeaderFormatException, IOException
VPFHeaderFormatException
- if an error occursIOException
- if an error occursprotected int readInteger() throws IOException
int
valueIOException
- if an error occursprotected byte[] readNumber(int cnt) throws IOException
cnt
- an int
value indicating the number of bytes to retrievebyte[]
valueIOException
- if an error occursprotected short readShort() throws IOException
short
valueIOException
- if an error occursprotected String readString(String terminators) throws IOException
terminators
- a String
value indicating the terminators to look forString
valueIOException
- if an error occursprotected TripletId readTripletId() throws IOException
TripletId
valueIOException
- on any IO errorsprotected Object readVariableSizeData(char dataType) throws IOException
dataType
- a char
value indicating the data typeObject
valueIOException
- if an error occurspublic void reset()
public void close() throws IOException
IOException
- in some unlikely situationprotected void setPosition(long pos) throws IOException
pos
- A 1-indexed positionIOException
- on any IO failuresprotected void unread(long bytes) throws IOException
bytes
- a long
valueIOException
- if an error occurspublic VPFColumn getColumn(int index)
public int getColumnCount()
public AttributeDescriptor getDescriptor(String name)
Copyright © 1996–2022 Geotools. All rights reserved.