The Index object’s add() method, AddToIndex(), accepts an object to be indexed and a list of keywords in the form of a KeywordList object. For each keyword in the KeywordList, AddToIndex() first checks to see whether an IndexItemList object is associated with the keyword. Note that it uses the keyword value itself as an index into the array.
If no IndexItemList object exists for the keyword, a new object is created and added to the array, again using the keyword as the index. Finally, the object to be indexed is added to the IndexItemList for that keyword value.