Statements (52)
| Predicate | Object |
|---|---|
| gptkbp:instanceOf |
gptkb:programming_language
|
| gptkbp:advantage |
enables polymorphic traversal
improves maintainability simplifies code |
| gptkbp:allows |
sequential access
element modification element removal |
| gptkbp:category |
gptkb:architecture
gptkb:Design_Pattern |
| gptkbp:commonIn |
gptkb:Java
gptkb:JavaScript gptkb:Python gptkb:C++ |
| gptkbp:compatibleWith |
random access
|
| gptkbp:definedIn |
design patterns
iterator pattern |
| gptkbp:example |
C++ STL iterator
Java Iterator interface JavaScript ES6 iterator protocol Python for loop for-each loop |
| gptkbp:feature |
can be external or internal
can be forward or bidirectional can be mutable or immutable decouples collection from traversal encapsulates iteration logic supports lazy evaluation |
| gptkbp:interface |
C++ std::iterator
Java.util.Iterator JavaScript Symbol.iterator Python iterator protocol |
| gptkbp:introducedIn |
Gang of Four design patterns book
|
| gptkbp:method |
hasNext()
next() remove() __iter__() __next__() |
| gptkbp:pattern |
behavioral pattern
|
| gptkbp:purpose |
abstract traversal logic
access elements of a collection traverse a container |
| gptkbp:relatedTo |
gptkb:Cursor
Generator Iterable Enumerator |
| gptkbp:usedIn |
object-oriented programming
computer programming functional programming |
| gptkbp:bfsParent |
gptkb:String.prototype.matchAll
gptkb:Standard_PHP_Library |
| gptkbp:bfsLayer |
7
|
| https://www.w3.org/2000/01/rdf-schema#label |
Iterator
|