Class ShapeFileIndexRecord
- java.lang.Object
-
- org.arakhne.afc.io.shape.ShapeFileIndexRecord
-
- All Implemented Interfaces:
Comparable<ShapeFileIndexRecord>
public class ShapeFileIndexRecord extends Object implements Comparable<ShapeFileIndexRecord>
This class describes a record inside a shape file index.The offset if the position of the first byte of the record inside the file. Basically, the first record is supporsed to have offset to 100 (ie,
ESRIFileUtil.HEADER_BYTES
). Because the ESRI standard stores this value as 16-bit words, it means that the offset is always a multiple of 2. If this record is created with an offset which is not a multiple of 2, this object will assumed the upper multiple as length.The length is the size of the content's part of the associated shape file entry. Because the ESRI standard stores this value as 16-bit words, it means that the length is always a multiple of 2. If this record is created with a length which is not a multiple of 2, an assertion may be invalidated in the constructor of this object (don't forget to activate assertions in your JVM to have them).
The specification of the ESRI Shape file format is described in the July 98 specification document.
- Since:
- 14.0
- Version:
- 17.0 2020-01-04 14:41:52
- Author:
- Stéphane GALLAND, Olivier LAMOTTE
- Maven Group Id:
- org.arakhne.afc.advanced
- Maven Artifact Id:
- shapefile
-
-
Constructor Summary
Constructors Constructor Description ShapeFileIndexRecord(int recordOffset, int length, boolean recordContentSize, int index)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(ShapeFileIndexRecord record)
boolean
equals(Object obj)
int
getEntireRecordLength()
Replies the length of the record (in bytes) including the record's header.int
getOffsetInContent()
Replies the offset of the record (in bytes) from the start of the content part of the shape file (file header excluded).int
getOffsetInFile()
Replies the offset of the record (in bytes) from the start of the whole shape file (file header included).int
getRecordContentLength()
Replies the length of the record (in bytes) excluding the record's header.int
getRecordIndex()
Replies index of the record if it is known, or-1
if unknown.int
hashCode()
String
toString()
-
-
-
Constructor Detail
-
ShapeFileIndexRecord
ShapeFileIndexRecord(int recordOffset, int length, boolean recordContentSize, int index)
Constructor.- Parameters:
recordOffset
- is the offset of the record, including the file header.length
- the length of the record.recordContentSize
- iftrue
indicates that the given length is the length of the record's content (without record header), iffalse
indicates that the given length is the length of the whole record (record header included).index
- is the index of the record.
-
-
Method Detail
-
compareTo
@Pure public int compareTo(ShapeFileIndexRecord record)
- Specified by:
compareTo
in interfaceComparable<ShapeFileIndexRecord>
-
getOffsetInFile
@Pure public int getOffsetInFile()
Replies the offset of the record (in bytes) from the start of the whole shape file (file header included).- Returns:
- the offset from the start of the file.
- See Also:
getOffsetInContent()
-
getOffsetInContent
@Pure public int getOffsetInContent()
Replies the offset of the record (in bytes) from the start of the content part of the shape file (file header excluded).- Returns:
- the offset from the start of the file.
- See Also:
getOffsetInFile()
-
getEntireRecordLength
@Pure public int getEntireRecordLength()
Replies the length of the record (in bytes) including the record's header.- Returns:
- the length of the record, including the record header part
- See Also:
getRecordContentLength()
-
getRecordContentLength
@Pure public int getRecordContentLength()
Replies the length of the record (in bytes) excluding the record's header.- Returns:
- the length of the record, excluding the record header part
- See Also:
getEntireRecordLength()
-
getRecordIndex
@Pure public int getRecordIndex()
Replies index of the record if it is known, or-1
if unknown.- Returns:
- the record index or
-1
if unknown.
-
-