| <!DOCTYPE html><meta charset="UTF-8"><meta http-equiv="Content-Language" content="en" /><title>goog.Uri.QueryData</title><link href="dossier.css" rel="stylesheet" type="text/css"><div id="main-wrapper"><input type="checkbox" id="sidenav-toggle" /><main><header><h1>Class goog.Uri.QueryData</h1><a class="source" href="source/lib/goog/uri/uri.js.src.html#l1026">code »</a></header><section><p>Class used to represent URI query parameters. It is essentially a hash of | |
| name-value pairs, though a name can be present more than once. | |
| Has the same interface as the collections in goog.structs.<h2>Constructor</h2><div class="ctor wrap-details public"><div><div class="ctor"><span class="member">goog.Uri.QueryData <span class="args">( opt_query, opt_uri, opt_ignoreCase )</span></span></div><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>opt_query: <code class="type">?<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>=</code><dd>Optional encoded query string to parse into | |
| the object.<dt>opt_uri: <code class="type"><a href="class_goog_Uri.html">goog.Uri</a>=</code><dd>Optional uri object that should have its | |
| cache invalidated when this object updates. Deprecated -- this | |
| is no longer required.<dt>opt_ignoreCase: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a>=</code><dd>If true, ignore the case of the parameter | |
| name in #get.</dl></table></div></div></div></section><div id="visibility-controls"><b>Show:</b><label for="show-public"><span><input type="checkbox" id="show-public" checked/></span>Public</label><label for="show-protected"><span><input type="checkbox" id="show-protected"/></span>Protected</label><label for="show-private"><span><input type="checkbox" id="show-private"/></span>Private</label></div><section id="instance-methods"><h2>Instance Methods</h2><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/uri/uri.js.src.html#l1170">code »</a><span class="member"><a name="add">add</a> <span class="args">( key, value )</span> ⇒ <code class="type">!<a href="class_goog_Uri_QueryData.html">goog.Uri.QueryData</a></code></span></div><p>Adds a key value pair.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>key: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code><dd>Name.<dt>value: <code class="type">*</code><dd>Value.</dl><tr><th>Returns<tr><td><dl>Instance of this object.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/uri/uri.js.src.html#l1208">code »</a><span class="member"><a name="clear">clear</a> <span class="args">( )</span></span></div><p>Clears the parameters.</summary></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/uri/uri.js.src.html#l1434">code »</a><span class="member"><a name="clone">clone</a> <span class="args">( )</span> ⇒ <code class="type">!<a href="class_goog_Uri_QueryData.html">goog.Uri.QueryData</a></code></span></div><p>Clone the query data instance.</summary><div class="info"><table><tbody><tr><th>Returns<tr><td><dl>New instance of the QueryData object.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/uri/uri.js.src.html#l1229">code »</a><span class="member"><a name="containsKey">containsKey</a> <span class="args">( key )</span> ⇒ <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code></span></div><p>Whether there is a parameter with the given name</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>key: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code><dd>The parameter name to check for.</dl><tr><th>Returns<tr><td><dl>Whether there is a parameter with the given name.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/uri/uri.js.src.html#l1241">code »</a><span class="member"><a name="containsValue">containsValue</a> <span class="args">( value )</span> ⇒ <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code></span></div><p>Whether there is a parameter with the given value.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>value: <code class="type">*</code><dd>The value to check for.</dl><tr><th>Returns<tr><td><dl>Whether there is a parameter with the given value.</dl></table></div></details></div></div><div class="wrap-details private"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/uri/uri.js.src.html#l1048">code »</a><span class="member"><a name="ensureKeyMapInitialized_">ensureKeyMapInitialized_</a> <span class="args">( )</span></span></div><p>If the underlying key map is not yet initialized, it parses the | |
| query string and fills the map with parsed data.</summary></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/uri/uri.js.src.html#l1492">code »</a><span class="member"><a name="extend">extend</a> <span class="args">( var_args )</span></span></div><p>Extends a query data object with another query data or map like object. This | |
| operates 'in-place', it does not create a new QueryData object.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>var_args: <code class="type">...(<a href="class_goog_Uri_QueryData.html">goog.Uri.QueryData</a>|<a href="class_goog_structs_Map.html">goog.structs.Map</a>|<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a>)</code><dd>The object | |
| from which key value pairs will be copied.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/uri/uri.js.src.html#l1418">code »</a><span class="member"><a name="filterKeys">filterKeys</a> <span class="args">( keys )</span> ⇒ <code class="type">!<a href="class_goog_Uri_QueryData.html">goog.Uri.QueryData</a></code></span></div><p>Removes all keys that are not in the provided list. (Modifies this object.)</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>keys: <code class="type"><a href="http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a>.<<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>></code><dd>The desired keys.</dl><tr><th>Returns<tr><td><dl>a reference to this object.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/uri/uri.js.src.html#l1331">code »</a><span class="member"><a name="get">get</a> <span class="args">( key, opt_default )</span> ⇒ <code class="type">*</code></span></div><p>Returns the first value associated with the key. If the query data has no | |
| such key this will return undefined or the optional default.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>key: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code><dd>The name of the parameter to get the value for.<dt>opt_default: <code class="type">*=</code><dd>The default value to return if the query data | |
| has no such key.</dl><tr><th>Returns<tr><td><dl>The first string value associated with the key, or opt_default | |
| if there's no value.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/uri/uri.js.src.html#l1158">code »</a><span class="member"><a name="getCount">getCount</a> <span class="args">( )</span> ⇒ <code class="type">?<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></code></span></div></summary><div class="info"><table><tbody><tr><th>Returns<tr><td><dl>The number of parameters.</dl></table></div></details></div></div><div class="wrap-details private"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/uri/uri.js.src.html#l1452">code »</a><span class="member"><a name="getKeyName_">getKeyName_</a> <span class="args">( arg )</span> ⇒ <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code></span></div><p>Helper function to get the key name from a JavaScript object. Converts | |
| the object to a string, and to lower case if necessary.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>arg: <code class="type">*</code><dd>The object to get a key name from.</dl><tr><th>Returns<tr><td><dl>valid key name which can be looked up in #keyMap_.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/uri/uri.js.src.html#l1255">code »</a><span class="member"><a name="getKeys">getKeys</a> <span class="args">( )</span> ⇒ <code class="type">!<a href="http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a>.<<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>></code></span></div><p>Returns all the keys of the parameters. If a key is used multiple times | |
| it will be included multiple times in the returned array</summary><div class="info"><table><tbody><tr><th>Returns<tr><td><dl>All the keys of the parameters.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/uri/uri.js.src.html#l1278">code »</a><span class="member"><a name="getValues">getValues</a> <span class="args">( opt_key )</span> ⇒ <code class="type">!<a href="http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></code></span></div><p>Returns all the values of the parameters with the given name. If the query | |
| data has no such key this will return an empty array. If no key is given | |
| all values wil be returned.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>opt_key: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>=</code><dd>The name of the parameter to get the values for.</dl><tr><th>Returns<tr><td><dl>All the values of the parameters with the given name.</dl></table></div></details></div></div><div class="wrap-details private"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/uri/uri.js.src.html#l1408">code »</a><span class="member"><a name="invalidateCache_">invalidateCache_</a> <span class="args">( )</span></span></div><p>Invalidate the cache.</summary></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/uri/uri.js.src.html#l1218">code »</a><span class="member"><a name="isEmpty">isEmpty</a> <span class="args">( )</span> ⇒ <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code></span></div></summary><div class="info"><table><tbody><tr><th>Returns<tr><td><dl>Whether we have any parameters.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/uri/uri.js.src.html#l1190">code »</a><span class="member"><a name="remove">remove</a> <span class="args">( key )</span> ⇒ <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code></span></div><p>Removes all the params with the given key.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>key: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code><dd>Name.</dl><tr><th>Returns<tr><td><dl>Whether any parameter was removed.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/uri/uri.js.src.html#l1303">code »</a><span class="member"><a name="set">set</a> <span class="args">( key, value )</span> ⇒ <code class="type">!<a href="class_goog_Uri_QueryData.html">goog.Uri.QueryData</a></code></span></div><p>Sets a key value pair and removes all other keys with the same value.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>key: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code><dd>Name.<dt>value: <code class="type">*</code><dd>Value.</dl><tr><th>Returns<tr><td><dl>Instance of this object.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/uri/uri.js.src.html#l1467">code »</a><span class="member"><a name="setIgnoreCase">setIgnoreCase</a> <span class="args">( ignoreCase )</span></span></div><p>Ignore case in parameter names. | |
| NOTE: If there are already key/value pairs in the QueryData, and | |
| ignoreCase_ is set to false, the keys will all be lower-cased.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>ignoreCase: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code><dd>whether this goog.Uri should ignore case.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/uri/uri.js.src.html#l1347">code »</a><span class="member"><a name="setValues">setValues</a> <span class="args">( key, values )</span></span></div><p>Sets the values for a key. If the key already exists, this will | |
| override all of the existing values that correspond to the key.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>key: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code><dd>The key to set values for.<dt>values: <code class="type"><a href="http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></code><dd>The values to set.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/uri/uri.js.src.html#l1399">code »</a><span class="member"><a name="toDecodedString">toDecodedString</a> <span class="args">( )</span> ⇒ <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code></span></div></summary><div class="info"><table><tbody><tr><th>Returns<tr><td><dl>Decoded query string.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/uri/uri.js.src.html#l1362">code »</a><span class="member"><a name="toString">toString</a> <span class="args">( )</span> ⇒ <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code></span></div></summary><div class="info"><table><tbody><tr><th>Returns<tr><td><dl>Encoded query string.</dl></table></div></details></div></div></section><section id="instance-properties"><h2>Instance Properties</h2><div class="wrap-details private"><div><details><summary><div><a class="source" href="source/lib/goog/uri/uri.js.src.html#l1152">code »</a><span class="member"><a name="count_">count_</a> : <code class="type">?<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></code></span></div><p>The number of params, or null if it requires computing.</summary></details></div></div><div class="wrap-details private"><div><details><summary><div><a class="source" href="source/lib/goog/uri/uri.js.src.html#l1032">code »</a><span class="member"><a name="encodedQuery_">encodedQuery_</a> : <code class="type">?<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code></span></div><p>Encoded query string, or null if it requires computing from the key map.</summary></details></div></div><div class="wrap-details private"><div><details><summary><div><a class="source" href="source/lib/goog/uri/uri.js.src.html#l1039">code »</a><span class="member"><a name="ignoreCase_">ignoreCase_</a> : <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code></span></div><p>If true, ignore the case of the parameter name in #get.</summary></details></div></div><div class="wrap-details private"><div><details><summary><div><a class="source" href="source/lib/goog/uri/uri.js.src.html#l1144">code »</a><span class="member"><a name="keyMap_">keyMap_</a> : <code class="type"><a href="class_goog_structs_Map.html">goog.structs.Map</a>.<<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>, <a href="http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a>></code></span></div><p>The map containing name/value or name/array-of-values pairs. | |
| May be null if it requires parsing from the query string. | |
| We need to use a Map because we cannot guarantee that the key names will | |
| not be problematic for IE.</summary></details></div></div></section><section id="static-functions"><h2>Static Functions</h2><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/uri/uri.js.src.html#l1121">code »</a><span class="member"><a name="goog.Uri.QueryData.createFromKeysValues">goog.Uri.QueryData.createFromKeysValues</a> <span class="args">( keys, values, opt_uri, opt_ignoreCase )</span> ⇒ <code class="type">!<a href="class_goog_Uri_QueryData.html">goog.Uri.QueryData</a></code></span></div><p>Creates a new query data instance from parallel arrays of parameter names | |
| and values. Allows for duplicate parameter names. Throws an error if the | |
| lengths of the arrays differ.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>keys: <code class="type"><a href="http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a>.<<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>></code><dd>Parameter names.<dt>values: <code class="type"><a href="http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></code><dd>Parameter values.<dt>opt_uri: <code class="type"><a href="class_goog_Uri.html">goog.Uri</a>=</code><dd>URI object that should have its cache | |
| invalidated when this object updates.<dt>opt_ignoreCase: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a>=</code><dd>If true, ignore the case of the parameter | |
| name in #get.</dl><tr><th>Returns<tr><td><dl>The populated query data instance.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/uri/uri.js.src.html#l1087">code »</a><span class="member"><a name="goog.Uri.QueryData.createFromMap">goog.Uri.QueryData.createFromMap</a> <span class="args">( map, opt_uri, opt_ignoreCase )</span> ⇒ <code class="type">!<a href="class_goog_Uri_QueryData.html">goog.Uri.QueryData</a></code></span></div><p>Creates a new query data instance from a map of names and values.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>map: <code class="type">(!<a href="class_goog_structs_Map.html">goog.structs.Map</a>|!<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a>)</code><dd>Map of string parameter | |
| names to parameter value. If parameter value is an array, it is | |
| treated as if the key maps to each individual value in the | |
| array.<dt>opt_uri: <code class="type"><a href="class_goog_Uri.html">goog.Uri</a>=</code><dd>URI object that should have its cache | |
| invalidated when this object updates.<dt>opt_ignoreCase: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a>=</code><dd>If true, ignore the case of the parameter | |
| name in #get.</dl><tr><th>Returns<tr><td><dl>The populated query data instance.</dl></table></div></details></div></div></section></main><nav id="topnav"><div><div id="menubutton"><label for="sidenav-toggle">Menu</label></div><form id="searchbox"><div><input type="search" placeholder="Search" tabindex="1"></div></form></div></nav><nav id="sidenav"><input type="checkbox" id="sidenav-types-ctrl" /><input type="checkbox" id="sidenav-files-ctrl" /><input type="checkbox" id="sidenav-modules-ctrl" /><a id="sidenav-overview"><div><h4>Overview</h4></div></a><div id="sidenav-types"><label for="sidenav-types-ctrl"><h4>Types</h4></label><i>No data</i></div><div id="sidenav-modules"><label for="sidenav-modules-ctrl"><h4>Modules</h4></label><i>No data</i></div><div id="sidenav-files"><label for="sidenav-files-ctrl"><h4>Files</h4></label><i>No data</i></div><a href="license.html"><div><h4>License</h4></div></a></nav><div id="push-footer"></div></div><footer><a href="https://github.com/jleyba/js-dossier">Generated by dossier</a></footer><script src="types.js"></script><script src="dossier.js"></script> |