⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 14.03 - publiclibraryvirtualproxy class.js

📁 JS设计模式源代码
💻 JS
字号:
/* PublicLibraryVirtualProxy class. */var PublicLibraryVirtualProxy = function(catalog) { // implements Library  this.library = null;  this.catalog = catalog; // Store the argument to the constructor.};PublicLibraryVirtualProxy.prototype = {  _initializeLibrary: function() {    if(this.library === null) {      this.library = new PublicLibrary(this.catalog);    }  },  findBooks: function(searchString) {    this._initializeLibrary();    return this.library.findBooks(searchString);  },  checkoutBook: function(book) {    this._initializeLibrary();    return this.library.checkoutBook(book);  },  returnBook: function(book) {    this._initializeLibrary();    return this.library.returnBook(book);  }};

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -