- java.lang.Object
-
- de.bernd_michaely.x3i.types.X3iData
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
getDataSize()
Returns the size of the data source in bytes.long
getDirectoryPointerLocation()
Returns the file offset in bytes from the beginning of the file where the FOV[b|i] directory pointer is located or -1, if it could not be found.long
getDirectoryPointerValue()
Returns the value of the FOV[b|i] directory pointer.List<X3fData>
getListEmbeddedX3f()
Returns a list of data structures describing the embedded FOVb data.int
getNumEmbeddedX3f()
Returns the number of FOVb entries (that is the number of directory entries of type "FRAM") independantly of the value ofisReadingFirstFOVbOnly()
.boolean
isLastX3fDamaged()
Returns true, if the last element ingetListEmbeddedX3f()
was created by an X3F recovery parser, false, if it was created by an X3F standard parser.boolean
isParsedSuccessfully()
Returns true, if the parser could read the FOV[b|i] data without problems.boolean
isReadingFirstFOVbOnly()
Returns true, if only the first FOVb entry was read.boolean
isRecoverable()
Returns true, if a possibly corrupted file is recoverable.boolean
isRecoveryMode()
Returns true, if a recovery parser was used, and not the standard parser.
-
-
-
Constructor Detail
-
X3iData
protected X3iData()
Protected constructor. Instances of this class are not to be created directly, but will be created by a parser.
-
X3iData
protected X3iData(boolean readingFirstFOVbOnly)
Constructor for unit tests.- Parameters:
readingFirstFOVbOnly
- if true, only the first entry should be read
-
-
Method Detail
-
getDataSize
public long getDataSize()
Description copied from interface:FovData
Returns the size of the data source in bytes. If this data structure is created by a recovery parser, and the full FOV[b|i] data is present plus some unneccessary data appended, this value will indicate the size of the FOV[b|i] data. That is it may e.g. be smaller than the size of the file it is read from. In case of an error -1 might be returned.- Specified by:
getDataSize
in interfaceFovData
- Returns:
- the size of the FOV[b|i] data in bytes
-
getDirectoryPointerLocation
public long getDirectoryPointerLocation()
Description copied from interface:FovData
Returns the file offset in bytes from the beginning of the file where the FOV[b|i] directory pointer is located or -1, if it could not be found.- Specified by:
getDirectoryPointerLocation
in interfaceFovData
- Returns:
- the file offset where the FOV[b|i] directory pointer is located
-
getDirectoryPointerValue
public long getDirectoryPointerValue()
Description copied from interface:FovData
Returns the value of the FOV[b|i] directory pointer. That is the offset in bytes from the beginning of the file of the FOV[b|i] directory section.- Specified by:
getDirectoryPointerValue
in interfaceFovData
- Returns:
- the value of the FOV[b|i] directory pointer
-
isParsedSuccessfully
public boolean isParsedSuccessfully()
Description copied from interface:FovData
Returns true, if the parser could read the FOV[b|i] data without problems. That is, the FOV[b|i] header and FOV[b|i] directory could be parsed according to the specification without an error occuring.- Specified by:
isParsedSuccessfully
in interfaceFovData
- Returns:
- true, if the parser could read the FOV[b|i] data successfully
-
isRecoverable
public boolean isRecoverable()
Description copied from interface:FovData
Returns true, if a possibly corrupted file is recoverable.- Specified by:
isRecoverable
in interfaceFovData
- Returns:
- true, if a possibly corrupted file is recoverable
-
isRecoveryMode
public boolean isRecoveryMode()
Description copied from interface:FovData
Returns true, if a recovery parser was used, and not the standard parser.- Specified by:
isRecoveryMode
in interfaceFovData
- Returns:
- true, if a recovery parser was used
-
isReadingFirstFOVbOnly
public boolean isReadingFirstFOVbOnly()
Returns true, if only the first FOVb entry was read. If true,getListEmbeddedX3f()
will return a list with at most one element, whilegetNumEmbeddedX3f()
will return the real number of embedded FOVb items.- Returns:
- true, if only the first FOVb entry was read
-
getNumEmbeddedX3f
public int getNumEmbeddedX3f()
Returns the number of FOVb entries (that is the number of directory entries of type "FRAM") independantly of the value ofisReadingFirstFOVbOnly()
.- Returns:
- the number of FOVb entries
-
getListEmbeddedX3f
public List<X3fData> getListEmbeddedX3f()
Returns a list of data structures describing the embedded FOVb data.- Returns:
- a list of data structures describing the embedded FOVb data
-
isLastX3fDamaged
public boolean isLastX3fDamaged()
Returns true, if the last element ingetListEmbeddedX3f()
was created by an X3F recovery parser, false, if it was created by an X3F standard parser.- Returns:
- true, if the last
X3fData
element is damaged
-
-