quanke
设计模式Java版

Updated 2 years ago

Damon Xu (@damonx) started discussion #36

10 months ago · 0 comments

Open

在图11-5中, AbstractFile充当抽象构件类,Folder充当容器构件类,ImageFile、TextFile和VideoFile充当叶子构件类。完整代码如下所示:

树形结构的处理——组合模式(三) (Edit this file)

抽象类中的ADD,REMOVE,GETCHILD就可以提供默认实现"对不起,不支持该方法“. 在非叶子节点上override这些方法就行了。

No description provided.

No comments on this discussion.


to join this conversation on GitBook. Already have an account? Sign in to comment
Notifications

You’re not receiving notifications from this thread.


1 participant