上一页 1 ··· 13 14 15 16 17 18 19 20 21 ··· 79 下一页
摘要: 模板方法模式是类的行为模式。准备一个抽象类,将部分逻辑以具体方法以及具体构造函数的形式实现,然后声明一些抽象方法来迫使子类实现余下的逻辑。不同的子类可以以不同的方式实现这些抽象方法,从而对剩余的逻辑有不同的实现。这就是模板方法模式的用意。 (学习) 模板方法模式的结构 模板方法模式是所有模式中最为常 阅读全文
posted @ 2021-01-27 12:12 johnny_zhao 阅读(141) 评论(0) 推荐(0) 编辑
摘要: 观察者模式是对象的行为模式,以叫发布-订阅(Publish/Subscribe)模式、模型-视图(Model/View)模式、源-监听器(Source/Listener)模式或从属者(Dependents)模式。 (学习) 观察者模式定义了一种一对多的依赖关系,让多个观察者对象同时监听某一个主题对象 阅读全文
posted @ 2021-01-27 12:10 johnny_zhao 阅读(53) 评论(0) 推荐(0) 编辑
摘要: 迭代子模式又叫游标(Cursor)模式,是对象的行为模式。迭代子模式可以顺序地访问一个聚集中的元素而不必暴露聚集的内部表象(internal representation)。 (学习) 聚集和java聚集 多个对象聚在一起形成的总体称之为聚集(Aggregate),聚集对象是能够包容一组对象的容器对 阅读全文
posted @ 2021-01-27 12:09 johnny_zhao 阅读(231) 评论(0) 推荐(0) 编辑
摘要: (参考) 阅读全文
posted @ 2021-01-27 12:07 johnny_zhao 阅读(42) 评论(0) 推荐(0) 编辑
摘要: 门面模式(Facade)是对象的结构模式,外部与一个子系统的通信必顺通过一个统一的门面对象进行。门面模式提供一个高层次的接口,使得子系统更易于使用。 (参考) 门面模式的结构 由于门面模式的结构图过于抽象,因此把它稍稍具体点。假设子系统内有三个模块,分别是ModuleA, ModuleB, Modu 阅读全文
posted @ 2021-01-25 12:41 johnny_zhao 阅读(106) 评论(0) 推荐(0) 编辑
摘要: package LeetCode_1395 /** * 1395. Count Number of Teams * https://leetcode.com/problems/count-number-of-teams/ * There are n soldiers standing in a li 阅读全文
posted @ 2021-01-23 12:19 johnny_zhao 阅读(70) 评论(0) 推荐(0) 编辑
摘要: package LeetCode_747 /** * 747. Largest Number At Least Twice of Others * https://leetcode.com/problems/largest-number-at-least-twice-of-others/ * In 阅读全文
posted @ 2021-01-22 16:21 johnny_zhao 阅读(61) 评论(0) 推荐(0) 编辑
摘要: package LeetCode_1160 /** * 1160. Find Words That Can Be Formed by Characters * https://leetcode.com/problems/find-words-that-can-be-formed-by-charact 阅读全文
posted @ 2021-01-22 13:03 johnny_zhao 阅读(73) 评论(0) 推荐(0) 编辑
摘要: package LeetCode_1539 /** * 1539. Kth Missing Positive Number * https://leetcode.com/problems/kth-missing-positive-number/ * Given an array arr of pos 阅读全文
posted @ 2021-01-21 23:44 johnny_zhao 阅读(69) 评论(0) 推荐(0) 编辑
摘要: package LeetCode_832 /** * 832. Flipping an Image * https://leetcode.com/problems/flipping-an-image/ * Given a binary matrix A, we want to flip the im 阅读全文
posted @ 2021-01-20 22:26 johnny_zhao 阅读(63) 评论(0) 推荐(0) 编辑
上一页 1 ··· 13 14 15 16 17 18 19 20 21 ··· 79 下一页