Documentation for maplib/Feature.kt¶
- data class DateComponents¶
Date components class to transform from separate values of year, month, day, hour, minute and second to date.
- fun constructor(year: Int, month: Int, day: Int, hour: Int, minute: Int, second: Int, gmtOffset: Int)¶
Main constructor
- Параметры
year – r Year value
month – h Month value
day – y Day value
hour – r Hour value
minute – e Minute value
second – d Second value
gmtOffset – t Time zone offset value
- fun toDate() : Date¶
Transform to date class.
- Результат
Date class instance.
- class Feature¶
Feature or row.
- fun constructor(handle: Long, table: Table)¶
Main constructor
- Параметры
handle – e Feature handle for C API.
table – e Table the feature belongs to.
- fun isFieldSet(index: Int) : Boolean¶
Check if field set.
- Параметры
index – Field index.
- Результат
True if field set.
- fun getFieldAsInteger(index: Int) : Int¶
Get field integer value.
- Параметры
index – Field index.
- Результат
Field value.
- fun getFieldAsDouble(index: Int) : Double¶
Get field double value.
- Параметры
index – Field index.
- Результат
Field value.
- fun getFieldAsString(index: Int) : String¶
Get field string value.
- Параметры
index – Field index.
- Результат
Field value.
- fun getFieldAsDateTime(index: Int) : Date¶
Get field value.
- Параметры
index – Field index.
- Результат
Field value.
- fun setField(index: Int, value: String)¶
Set field value.
- Параметры
index – Field index.
value – Value to set.
- fun setField(index: Int, value: Double)
Set field value.
- Параметры
index – Field index.
value – Value to set.
- fun setField(index: Int, value: Int)
Set field value.
- Параметры
index – Field index.
value – Value to set.
- fun setField(index: Int, value: Date)
Set field value.
- Параметры
index – Field index.
value – Value to set.
- fun createGeometry() : Geometry?¶
Create new geometry. The type of geometry will be corespondent to feature class geometry type.
- Результат
Geometry class instance or null.
- fun getAttachment(aid: Long) : Attachment?¶
Get attachment.
- Параметры
aid – Attachment identifier.
- Результат
Attachment class instance or null.
- fun getAttachments() : Array<Attachment>¶
Get all attachments.
- Результат
Attachment array.
- fun addAttachment(name: String, description: String, path: String, move: Boolean, remoteId: Long = -1, logEdits: Boolean = true) : Long¶
Add new attachment.
- Параметры
name – Name.
description – Description text.
path – File system path.
move – If true the attachment file will be
remoteId – Remote identifier.
logEdits – Log edits in history table. This log can be received using editOperations function.
- Результат
New attachment identifier.
- fun deleteAttachment(aid: Long, logEdits: Boolean = true) : Boolean¶
Delete attachment.
- Параметры
aid – Attachment identifier.
logEdits – Log edits in history table. This log can be received using editOperations function.
- Результат
True on success.
- fun deleteAttachment(attachment: Attachment, logEdits: Boolean = true) : Boolean¶
Delete attachment.
- Параметры
attachment – Attachment class instance.
logEdits – Log edits in history table. This log can be received using editOperations function.
- Результат
True on success.
- class Attachment¶
Attachment class. A file added to the feature/row
- fun constructor(handle: Long = 0, id: Long, name: String, description: String, path: String, size: Long, remoteIdVal: Long)¶
Main constructor
- Параметры
handle – e Handle of attachment or 0 for new one.
id – d Attachment id.
name – e Attachment name.
description – n Attachment description.
path – h Attachment file path in file system.
size – e Attachment file size.
- val handle : Long = 0
e Handle of attachment or 0 for new one.
- val id : Long
d Attachment id.
- fun isFileAvailable() : Boolean¶
Is attachment file available on disk.
- Результат
True of file exists.
- fun update(name: String, description: String, logEdits: Boolean = true) : Boolean¶
Update attachment. Only name and description can be updated. To change attachment file, just delete attachment and create new one.
- Параметры
name – New attachment name.
description – New attachment description.
logEdits – Log edits in history table. This log can be received using editOperations function.
- Результат
True on success.