Class: Collect (of Obj)

The Collect class is used to handle a collection of elements, such as objects.

Properties

  • elements
  • size

Methods

  • void dispose()

    Disposes of the class and all of it's elements.

  • string showStr(string strBuf)

    Returns a string into strBuf stating the object name and collection size.

  • void showSelf()

    For the object and each of it's elements, this prints the object's name and collection size on the screen in a dialog box.

  • heapPtr add(nodes)

    Adds the given nodes to the collection of elements. It returns a pointer to the object.

  • heapPtr delete(nodes)

    Deletes the specified nodes from the collection of elements. It returns a pointer to the object.

  • void eachElementDo(selector aSelector[,sendParams])

    For each element, this calls aSelector (a method or property), and if given, the rest of the sendParams.

  • heapPtr firstTrue(selector aSelector[,sendParams])

    For each element, this calls aSelector (a method or property), and if given, the rest of the sendParams. The first send to an element to return TRUE will cause firstTrue to return a pointer to that object. If no send returns TRUE, firstTrue will return NULL.

  • bool allTrue(selector aSelector[,sendParams])

    For each element, this calls aSelector (a method or property), and if given, the rest of the sendParams. If any send to an element returns FALSE, allTrue will return FALSE as well. Otherwise, if all sends have returned TRUE, so will allTRUE.

  • bool contains(heapPtr aNode)

    Checks to see if the object contains aNode in it's collection of elements.

  • bool isEmpty()

    Returns TRUE is the collection contains no nodes (elements). Otherwise, it returns FALSE.

  • heapPtr first()

    Returns a pointer to the first node in the collection.

  • heapPtr next(heapPtr pNode)

    Returns a pointer to the node after the specified one.

  • void release()

    Deletes all the nodes (elements) from the collection.