Skip to content

Latest commit

 

History

History
39 lines (28 loc) · 687 Bytes

File metadata and controls

39 lines (28 loc) · 687 Bytes

迭代器模式

概述

类图

classDiagram
    class Client {
        
    }
    
    class Iterator {
        <<interface>>
        
        + get_next()
    }
    
    class IterableCollection {
        <<interface>>
        
        + create_iterator() Iterator
    }
    
    class ConcreteIterator {
        - ConcreteCollection collection 
    }
    
    class ConcreteCollection {
        + create_iterator() Iterator
    }
    
    Client --> Iterator
    Client --> IterableCollection
    IterableCollection ..> Iterator 
    Iterator <|-- ConcreteIterator 
    IterableCollection <|-- ConcreteCollection
    ConcreteIterator <--> ConcreteCollection
Loading