This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Configuration file | |
| class ConfigFile { | |
| private final long SEEK = 99999; | |
| public long getSeek() {return SEEK;}; | |
| private long pointer; | |
| public long getPointer() {return seek;}; | |
| public void setPointer(long pointer) {this.pointer = pointer;}; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //Configuration file | |
| class ConfigFile { | |
| //The seek to move the cursor to the next line in a binary file of database index | |
| val seek : Long = 99999 | |
| var pointer : Long | |
| get() = $pointer | |
| set(value) { | |
| if (value >= 0) { | |
| $pointer = value | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class ConfigFile { | |
| val seek : Long = 99999 | |
| var pointer : Long = 0 | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| fun increasePointer(configFile : configFile, value: Long) : ConfigFile { | |
| val result = ConfigFile() | |
| result.pointer = configFile.pointer + value // accessors are called | |
| return result | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var <propertyName> : <PropertyType> [= <property_initializer>] | |
| <getter> | |
| <setter> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var allByDefault : Int? // ошибка: требуется явный инициализатор, геттеры и сеттеры по умолчанию | |
| var initialized = 1 // тип Int, геттеры и сеттеры по умолчанию | |
| var setterVisibility : String = "abc" // Используется инициализатор, не null | |
| private set // Сеттер приватный и имеет реализацию по умолчанию |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public val example : Int = 1 // Публичное свойство должно иметь тип, заданный явно (например Int) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| val seek : Long | |
| get() = this.size == 99999 | |
| var pointer : Long | |
| get() = this.toString() | |
| set(value) { | |
| setData(value) // устанавливает значение для других свойств | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var pointer : Long | |
| get() = this.toString() | |
| set(value) { | |
| if (value >=0) { $seek = value } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| val seek : Long | |
| get() = this.seek > 99 |
OlderNewer