OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 27 matching lines...) Expand all Loading... |
38 * @param {string} word | 38 * @param {string} word |
39 */ | 39 */ |
40 addWord: function(word) { }, | 40 addWord: function(word) { }, |
41 | 41 |
42 /** | 42 /** |
43 * @param {string} word | 43 * @param {string} word |
44 */ | 44 */ |
45 removeWord: function(word) { }, | 45 removeWord: function(word) { }, |
46 | 46 |
47 /** | 47 /** |
| 48 * @param {string} word |
| 49 * @return {boolean} |
| 50 */ |
| 51 hasWord: function(word) { }, |
| 52 |
| 53 /** |
48 * @param {string} prefix | 54 * @param {string} prefix |
49 * @return {Array.<string>} | 55 * @return {Array.<string>} |
50 */ | 56 */ |
51 wordsWithPrefix: function(prefix) { } | 57 wordsWithPrefix: function(prefix) { } |
52 } | 58 } |
53 | 59 |
54 /** | 60 /** |
55 * @constructor | 61 * @constructor |
56 * @implements {WebInspector.CompletionDictionary} | 62 * @implements {WebInspector.CompletionDictionary} |
57 */ | 63 */ |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 * @return {Array.<string>} | 95 * @return {Array.<string>} |
90 */ | 96 */ |
91 wordsWithPrefix: function(prefix) | 97 wordsWithPrefix: function(prefix) |
92 { | 98 { |
93 var words = []; | 99 var words = []; |
94 for(var i in this._words) { | 100 for(var i in this._words) { |
95 if (i.startsWith(prefix)) | 101 if (i.startsWith(prefix)) |
96 words.push(i); | 102 words.push(i); |
97 } | 103 } |
98 return words; | 104 return words; |
| 105 }, |
| 106 |
| 107 /** |
| 108 * @param {string} word |
| 109 * @return {boolean} |
| 110 */ |
| 111 hasWord: function(word) |
| 112 { |
| 113 return !!this._words[word]; |
99 } | 114 } |
100 } | 115 } |
OLD | NEW |