Difference between revisions of "ObjectType:index"

From Lavish Software Wiki
Jump to navigation Jump to search
Line 1: Line 1:
 
== Description ==
 
== Description ==
{{ObjectType-Vitals|index|[[LavishScript]]|[[ObjectType:objectcollection|objectcollection]]|NULL|[[ObjectType:index|index]]|yes|LSIndex *}}
+
{{ObjectType-Vitals|index|[[LavishScript]]|[[ObjectType:objectcontainer|objectcontainer]]|NULL|[[ObjectType:index|index]]|yes|LSIndex *}}
 
An index is a dynamically-sized list of objects.  In contrast to [[ObjectType:array|arrays]], elements in an index are not created when the index is sized -- the elements do not exist until set.
 
An index is a dynamically-sized list of objects.  In contrast to [[ObjectType:array|arrays]], elements in an index are not created when the index is sized -- the elements do not exist until set.
  

Revision as of 15:41, 7 May 2006

Description

Object Type Vitals
index
Defined By LavishScript
Inherits objectcontainer
Reduces To NULL
Variable Object Type index
Uses Sub-Types yes
C/C++ Type LSIndex *

An index is a dynamically-sized list of objects. In contrast to arrays, elements in an index are not created when the index is sized -- the elements do not exist until set.

Members

  • uint Next[#]: Retrieves the ID of the next valid element in the index, given an ID number
  • sub-type Get[#]: Retrieves the #th element in the index
  • uint Insert[...]: Inserts an element in the index. The parameters will be passed to the object initialization routine for the index sub-type, and an object will be created. The returned value is the ID of the new element.

Methods

  • Remove[#]: Removes a single element from the index, by ID
  • Collapse: Removes gaps in the index (from removal of elements) by shifting elements toward 1
  • Move[#,#]: Moves an element to a new position in the index, by ID numbers. If an element exists in the new position, it is destroyed
  • Swap[#,#]: Swaps two positiosn in the index
  • Set[#,...]: Creates a new element in the index at the given position (destroying the previous element, if it existed). The additional parameters will be passed to the object initialization routine for the index sub-type, and an object will be created.

Examples

See Also