Difference between revisions of "ObjectType:set"
Jump to navigation
Jump to search
(4 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
+ | {{ObjectType-Vitals|set|[[LavishScript]]|[[ObjectType:objectcontainer|objectcontainer]]|NULL|set|no|LSSet *}} | ||
== Overview == | == Overview == | ||
− | |||
A '''set''' is a sorted list of keys. It can be thought of as a [[ObjectType:collection|collection]] where the key ''is'' the object -- the key is either present, or it is absent. Keys are text, and not case sensitive. | A '''set''' is a sorted list of keys. It can be thought of as a [[ObjectType:collection|collection]] where the key ''is'' the object -- the key is either present, or it is absent. Keys are text, and not case sensitive. | ||
+ | |||
== Members == | == Members == | ||
− | * [[ObjectType:bool|bool]] '''Contains['''key''']''': | + | * [[ObjectType:bool|bool]] '''Contains['''key''']''': TRUE if the given key exists in the set |
− | * [[ObjectType: | + | *[[ObjectType:unistring|unistring]] '''AsJSON''': Returns a JSON array representation of this array, with each element converted by using its AsJSON member |
− | + | ||
− | |||
== Methods == | == Methods == | ||
− | *'''Add['''key''']''': | + | * '''ForEach['''code''']''': For each element in the set, performs the specified code. The [[TLO:ForEach|ForEach Top-Level Object]] is used to access the Value for each iteration |
− | *'''Remove['''key''']''': | + | *'''Add['''key''']''': Adds a given key to the set |
− | *'''Intersect''': | + | *'''Remove['''key''']''': Removes a given key from the set |
− | *'''Union''': | + | *'''Intersect['''set A''','''set B''']''': Adds "sets A and intersect B" to this set |
− | *'''Not''' | + | *'''Union['''set A''','''set B''']''': Adds "set A union B" to this set |
− | + | *'''Not['''set A''','''set B''']''': Adds "set A not B" to this set | |
− | + | ||
== See Also == | == See Also == | ||
− | + | {{LavishScript:ObjectType}} | |
− | |||
− |
Latest revision as of 14:49, 14 October 2019
set | |
Defined By | LavishScript |
Inherits | objectcontainer |
Reduces To | NULL |
Variable Object Type | set |
Uses Sub-Types | no |
C/C++ Type | LSSet * |
Contents
Overview
A set is a sorted list of keys. It can be thought of as a collection where the key is the object -- the key is either present, or it is absent. Keys are text, and not case sensitive.
Members
- bool Contains[key]: TRUE if the given key exists in the set
- unistring AsJSON: Returns a JSON array representation of this array, with each element converted by using its AsJSON member
Methods
- ForEach[code]: For each element in the set, performs the specified code. The ForEach Top-Level Object is used to access the Value for each iteration
- Add[key]: Adds a given key to the set
- Remove[key]: Removes a given key from the set
- Intersect[set A,set B]: Adds "sets A and intersect B" to this set
- Union[set A,set B]: Adds "set A union B" to this set
- Not[set A,set B]: Adds "set A not B" to this set
See Also
LavishScript Object Types
- Text
- string - mutablestring - unistring
- Numbers
- byte - float - float64 - int - uint - int64
- Boolean (TRUE/FALSE)
- bool
- Pointers
- boolptr - byteptr - floatptr - float64ptr - intptr - uintptr - int64ptr - rgbptr - stringptr
- Containers
- objectcontainer - array - index - collection - queue - stack - set - variablescope
- JSON
- jsonobject - jsonarray - jsonvaluecontainer - jsonvalue
- Iteration
- iterator - jsoniterator
- Date/Time
- time
- File Handling
- filepath - file - filelist - filelistentry
- Tasks
- lavishmachine - Accessed via the Top-Level Object LMAC
- task - tasklibrary - taskmanager - tasktype - taskpulseargs - elmactaskstate