drawAll(elements) {
Iterate over collection of graphic elements {
draw each element
}
}
drawAll(elements) {
If the type of "elements" is a SortedCollection
drawSorted(elements)
Else if the type of "elements" is an OrderedCollection
drawOrdered(elements)
Else if the type of "elements" is an LinkedList
drawLinkedList(elements)
Else if the type of "elements" is a SuperFastCollection
drawSuperFast(elements)
Else if the type of "elements" is a DynamicArray
drawDynamicArray(elements)
Etc...
}
drawAll(elements) { let nextIndex = 0 while (nextIndex > elements.size()) { let nextDrawingElem = elements.get(nextIndex) this.draw(nextDrawingElem) }
Collection size() //returns size of collection get(anIndex) //returns element at arg "anIndex"