Difference between revisions of "Lua:Class:Stringlist"
Jump to navigation
Jump to search
(filled out a proper class template for the StringList class) |
m |
||
Line 2: | Line 2: | ||
StringList '''class''': ('''Inheritance''': ''[[Lua:Class:Strings|Strings]]''->''[[Lua:Class:Object|Object]]'') | StringList '''class''': ('''Inheritance''': ''[[Lua:Class:Strings|Strings]]''->''[[Lua:Class:Object|Object]]'') | ||
− | + | The Stringlist class represents a list of strings with optional sorting, duplicate handling, and case sensitivity. | |
− | + | You can create a Stringlist object using <code>createStringlist()</code>. | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
== Properties == | == Properties == | ||
− | + | {| class="wikitable" style="width:100%" | |
− | + | ! Property | |
− | + | ! Type | |
− | + | ! Description | |
− | + | |- | |
− | + | | Sorted | |
− | + | | Boolean | |
− | + | | Determines if the list should be sorted. | |
− | + | |- | |
− | + | | Duplicates | |
+ | | [[DuplicatesType]] | ||
+ | | Determines how duplicates are handled when the list is sorted (see enum below). | ||
+ | |- | ||
+ | | CaseSensitive | ||
+ | | Boolean | ||
+ | | Determines if the list is case sensitive. | ||
+ | |} | ||
== Methods == | == Methods == | ||
− | + | {| class="wikitable" style="width:100%" | |
− | + | ! Method | |
− | + | ! Parameters | |
− | + | ! Returns | |
− | + | ! Description | |
− | + | |- | |
− | + | | getDuplicates | |
− | + | | None | |
− | + | | [[DuplicatesType]] | |
− | + | | Returns the duplicates property. | |
− | + | |- | |
− | + | | setDuplicates | |
− | + | | [[DuplicatesType]] | |
− | + | | None | |
− | + | | Sets the duplicates property (<code>dupIgnore</code>, <code>dupAccept</code>, <code>dupError</code>). | |
+ | |- | ||
+ | | getSorted | ||
+ | | None | ||
+ | | Boolean | ||
+ | | Returns true if the list is sorted. | ||
+ | |- | ||
+ | | setSorted | ||
+ | | Boolean | ||
+ | | None | ||
+ | | Sets the sorted property. | ||
+ | |- | ||
+ | | getCaseSensitive | ||
+ | | None | ||
+ | | Boolean | ||
+ | | Returns true if the list is case sensitive. | ||
+ | |- | ||
+ | | setCaseSensitive | ||
+ | | Boolean | ||
+ | | None | ||
+ | | Sets the case sensitive property. | ||
+ | |} | ||
− | + | == DuplicatesType Enum == | |
− | + | {| class="wikitable" | |
+ | ! Name | ||
+ | ! Value | ||
+ | ! Description | ||
+ | |- | ||
+ | | dupIgnore | ||
+ | | 0 | ||
+ | | Ignore duplicate entries. | ||
+ | |- | ||
+ | | dupAccept | ||
+ | | 1 | ||
+ | | Accept duplicate entries. | ||
+ | |- | ||
+ | | dupError | ||
+ | | 2 | ||
+ | | Raise an error on duplicate entries. | ||
+ | |} | ||
{{LuaSeeAlso}} | {{LuaSeeAlso}} |
Latest revision as of 18:28, 11 July 2025
StringList class: (Inheritance: Strings->Object)
The Stringlist class represents a list of strings with optional sorting, duplicate handling, and case sensitivity.
You can create a Stringlist object using createStringlist()
.
Properties[edit]
Property | Type | Description |
---|---|---|
Sorted | Boolean | Determines if the list should be sorted. |
Duplicates | DuplicatesType | Determines how duplicates are handled when the list is sorted (see enum below). |
CaseSensitive | Boolean | Determines if the list is case sensitive. |
Methods[edit]
Method | Parameters | Returns | Description |
---|---|---|---|
getDuplicates | None | DuplicatesType | Returns the duplicates property. |
setDuplicates | DuplicatesType | None | Sets the duplicates property (dupIgnore , dupAccept , dupError ).
|
getSorted | None | Boolean | Returns true if the list is sorted. |
setSorted | Boolean | None | Sets the sorted property. |
getCaseSensitive | None | Boolean | Returns true if the list is case sensitive. |
setCaseSensitive | Boolean | None | Sets the case sensitive property. |
DuplicatesType Enum[edit]
Name | Value | Description |
---|---|---|
dupIgnore | 0 | Ignore duplicate entries. |
dupAccept | 1 | Accept duplicate entries. |
dupError | 2 | Raise an error on duplicate entries. |