src/cm/media/js/lib/yui/yui3.0.0/api/State.html
author Yves-Marie Haussonne <ymh.work+github@gmail.com>
Fri, 09 May 2014 18:35:26 +0200
changeset 656 a84519031134
parent 0 40c8f766c9b8
permissions -rw-r--r--
add link to "privacy policy" in the header test

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html xmlns:yui="http://yuilibrary.com/rdf/1.0/yui.rdf#">
<head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
	<title>API: attribute  State   (YUI Library)</title>

	<link rel="stylesheet" type="text/css" href="assets/reset-fonts-grids-min.css" />
	<link rel="stylesheet" type="text/css" href="assets/api.css" />

    <script type="text/javascript" src="assets/api-js"></script>
    <script type="text/javascript" src="assets/ac-js"></script>
</head>

<body id="yahoo-com">

<div id="doc3" class="yui-t2">
	<div id="hd">
        <h1><a href="http://developer.yahoo.com/yui/" title="Yahoo! UI Library">Yahoo! UI Library</a></h1>
        <h3>attribute&nbsp; <span class="subtitle">3.0.0</span></h3>
        <a href="./index.html" title="Yahoo! UI Library">Yahoo! UI Library</a> 
            &gt; <a href="./module_attribute.html" title="attribute">attribute</a>
                 &gt; State 
                
        <form onsubmit="return false">
            <div id="propertysearch">
                Search: <input autocomplete="off" id="searchinput" />
                <div id="searchresults">
                    &nbsp;
                </div>
            </div>
        </form>
	</div>

	<div id="bd">
		<div id="yui-main">
			<div class="yui-b">
            <form action="#" name="yui-classopts-form" method="get" id="yui-classopts-form">
                <fieldset>
                    <legend>Filters</legend>
                <span class="classopts"><input type="checkbox" name="show_private" id="show_private" /> <label for="show_private">Show Private</label></span>
                <span class="classopts"><input type="checkbox" name="show_protected" id="show_protected" /> <label for="show_protected">Show Protected</label></span>
                <span class="classopts"><input type="checkbox" name="show_deprecated" id="show_deprecated" /> <label for="show_deprecated">Show Deprecated</label></span>
                </fieldset>
            </form>

                    <h2>
                        

                        
                        
                            Class <b property="yui:name">State</b>
                        <span class="extends">
                        </span>

                    </h2>
                    <!-- class tree goes here -->
                    
                
  

                    <div class="summary description" property="yui:description">
                        The State class maintains state for a collection of named items, with 
a varying number of properties defined.
It avoids the need to create a separate class for the item, and separate instances 
of these classes for each item, by storing the state in a 2 level hash table, 
improving performance when the number of items is likely to be large.
                    </div>

                        <div class="section constructor details" rel="yui:constructor" resource="#constructor">
                        <h3 id="constructor">Constructor</h3>
                        <div class="content">
                            <div class="detail">
                                <strong property="yui:name">State</strong>
                                <code>
                                    (
                                    )
                                </code>
                                <div class="description">
                                    
                                    
                                </div>
                            </div>
                        </div>
                    </div>
                    
                    <div rel="yui:properties" resource="#properties">
                        <div class="section field details">
                            <h3 id="properties">Properties</h3>
                            <div class="content">
                                    <div class="" rel="yui:property" resource="#property_data">
                                    <h4><a name="property_data" property="yui:name">data</a>
                                        - <code><span property="yui:type">object</span></code>
                                    </h4>
                                    <div class="detail">
                                        <div class="description" property="yui:description">
                                            Hash of attributes
                                        </div>
                                    </div>
     
                                        


                                    <hr />
                                    </div>
                            </div>
                        </div>

                    </div>

                    <div rel="yui:methods" resource="#methods">
                        <div class="section method details">
                            <h3 id="methods">Methods</h3>
                            <div class="content">
                                    <div class="" rel="yui:method" resource="#method_add">
                                    <h4>
                                        <a name="method_add">add</a></h4>
                                    <div class="detail" >
                                        <code>
                                        
                                        
                                        
                                        void
                                            <strong property="yui:name">add</strong>
                                           (
                                                
                                                        
                                                         name
                                                    
                                                
                                                        , 
                                                         key
                                                    
                                                
                                                        , 
                                                         val
                                                    
                                                
                                            )
                                        </code>
                                        
                                        <div class="description" property="yui:description">
                                            Adds a property to an item.
                                        </div>

                                        <div class="description">

                                                <dl rel="yui:parameters">
                                                    <dt>Parameters:</dt>
                                                        <dd rel="yui:parameter">
                                                        <code><span property="yui:name">name</span>
                                                        &lt;<span property="yui:type">String</span>&gt;
                                                        </code>
                                                        <span property="yui:description">  The name of the item.</span>
                                                        </dd>
                                                        <dd rel="yui:parameter">
                                                        <code><span property="yui:name">key</span>
                                                        &lt;<span property="yui:type">String</span>&gt;
                                                        </code>
                                                        <span property="yui:description">  The name of the property.</span>
                                                        </dd>
                                                        <dd rel="yui:parameter">
                                                        <code><span property="yui:name">val</span>
                                                        &lt;<span property="yui:type">Any</span>&gt;
                                                        </code>
                                                        <span property="yui:description">  The value of the property.</span>
                                                        </dd>
                                                </dl>



             

                                        </div>

                                    </div>
                                    <hr />
                                    </div>
                                    <div class="" rel="yui:method" resource="#method_addAll">
                                    <h4>
                                        <a name="method_addAll">addAll</a></h4>
                                    <div class="detail" >
                                        <code>
                                        
                                        
                                        
                                        void
                                            <strong property="yui:name">addAll</strong>
                                           (
                                                
                                                        
                                                         name
                                                    
                                                
                                                        , 
                                                         o
                                                    
                                                
                                            )
                                        </code>
                                        
                                        <div class="description" property="yui:description">
                                            Adds multiple properties to an item.
                                        </div>

                                        <div class="description">

                                                <dl rel="yui:parameters">
                                                    <dt>Parameters:</dt>
                                                        <dd rel="yui:parameter">
                                                        <code><span property="yui:name">name</span>
                                                        &lt;<span property="yui:type">String</span>&gt;
                                                        </code>
                                                        <span property="yui:description">  The name of the item.</span>
                                                        </dd>
                                                        <dd rel="yui:parameter">
                                                        <code><span property="yui:name">o</span>
                                                        &lt;<span property="yui:type">Object</span>&gt;
                                                        </code>
                                                        <span property="yui:description">  A hash of property/value pairs.</span>
                                                        </dd>
                                                </dl>



             

                                        </div>

                                    </div>
                                    <hr />
                                    </div>
                                    <div class="" rel="yui:method" resource="#method_get">
                                    <h4>
                                        <a name="method_get">get</a></h4>
                                    <div class="detail" >
                                        <code>
                                        
                                        
                                        
                                        Any
                                            <strong property="yui:name">get</strong>
                                           (
                                                
                                                        
                                                         name
                                                    
                                                
                                                        , 
                                                         key
                                                    
                                                
                                            )
                                        </code>
                                        
                                        <div class="description" property="yui:description">
                                            For a given item, returns the value of the property requested, or undefined if not found.
                                        </div>

                                        <div class="description">

                                                <dl rel="yui:parameters">
                                                    <dt>Parameters:</dt>
                                                        <dd rel="yui:parameter">
                                                        <code><span property="yui:name">name</span>
                                                        &lt;<span property="yui:type">String</span>&gt;
                                                        </code>
                                                        <span property="yui:description">  The name of the item</span>
                                                        </dd>
                                                        <dd rel="yui:parameter">
                                                        <code><span property="yui:name">key</span>
                                                        &lt;<span property="yui:type">String</span>&gt;
                                                        </code>
                                                        <span property="yui:description">  Optional. The property value to retrieve.</span>
                                                        </dd>
                                                </dl>

                                                <dl>
                                                    <dt>Returns:
                                                    <code property="yui:return">
                                                            Any
                                                    </code></dt>
                                                    <dd property="yui:returnInfo">The value of the supplied property.</dd>
                                                </dl>


             

                                        </div>

                                    </div>
                                    <hr />
                                    </div>
                                    <div class="" rel="yui:method" resource="#method_getAll">
                                    <h4>
                                        <a name="method_getAll">getAll</a></h4>
                                    <div class="detail" >
                                        <code>
                                        
                                        
                                        
                                        Object
                                            <strong property="yui:name">getAll</strong>
                                           (
                                                
                                                        
                                                         name
                                                    
                                                
                                            )
                                        </code>
                                        
                                        <div class="description" property="yui:description">
                                            For the given item, returns a disposable object with all of the
item's property/value pairs.
                                        </div>

                                        <div class="description">

                                                <dl rel="yui:parameters">
                                                    <dt>Parameters:</dt>
                                                        <dd rel="yui:parameter">
                                                        <code><span property="yui:name">name</span>
                                                        &lt;<span property="yui:type">String</span>&gt;
                                                        </code>
                                                        <span property="yui:description">  The name of the item</span>
                                                        </dd>
                                                </dl>

                                                <dl>
                                                    <dt>Returns:
                                                    <code property="yui:return">
                                                            Object
                                                    </code></dt>
                                                    <dd property="yui:returnInfo">An object with property/value pairs for the item.</dd>
                                                </dl>


             

                                        </div>

                                    </div>
                                    <hr />
                                    </div>
                                    <div class="" rel="yui:method" resource="#method_remove">
                                    <h4>
                                        <a name="method_remove">remove</a></h4>
                                    <div class="detail" >
                                        <code>
                                        
                                        
                                        
                                        void
                                            <strong property="yui:name">remove</strong>
                                           (
                                                
                                                        
                                                         name
                                                    
                                                
                                                        , 
                                                         key
                                                    
                                                
                                            )
                                        </code>
                                        
                                        <div class="description" property="yui:description">
                                            Removes a property from an item.
                                        </div>

                                        <div class="description">

                                                <dl rel="yui:parameters">
                                                    <dt>Parameters:</dt>
                                                        <dd rel="yui:parameter">
                                                        <code><span property="yui:name">name</span>
                                                        &lt;<span property="yui:type">String</span>&gt;
                                                        </code>
                                                        <span property="yui:description">  The name of the item.</span>
                                                        </dd>
                                                        <dd rel="yui:parameter">
                                                        <code><span property="yui:name">key</span>
                                                        &lt;<span property="yui:type">String</span>&gt;
                                                        </code>
                                                        <span property="yui:description">  The property to remove.</span>
                                                        </dd>
                                                </dl>



             

                                        </div>

                                    </div>
                                    <hr />
                                    </div>
                                    <div class="" rel="yui:method" resource="#method_removeAll">
                                    <h4>
                                        <a name="method_removeAll">removeAll</a></h4>
                                    <div class="detail" >
                                        <code>
                                        
                                        
                                        
                                        void
                                            <strong property="yui:name">removeAll</strong>
                                           (
                                                
                                                        
                                                         name
                                                    
                                                
                                                        , 
                                                         o
                                                    
                                                
                                            )
                                        </code>
                                        
                                        <div class="description" property="yui:description">
                                            Removes multiple properties from an item, or remove the item completely.
                                        </div>

                                        <div class="description">

                                                <dl rel="yui:parameters">
                                                    <dt>Parameters:</dt>
                                                        <dd rel="yui:parameter">
                                                        <code><span property="yui:name">name</span>
                                                        &lt;<span property="yui:type">String</span>&gt;
                                                        </code>
                                                        <span property="yui:description">  The name of the item.</span>
                                                        </dd>
                                                        <dd rel="yui:parameter">
                                                        <code><span property="yui:name">o</span>
                                                        &lt;<span property="yui:type">Object|Array</span>&gt;
                                                        </code>
                                                        <span property="yui:description">  Collection of properties to delete. If not provided, the entire item is removed.</span>
                                                        </dd>
                                                </dl>



             

                                        </div>

                                    </div>
                                    <hr />
                                    </div>
                            </div>
                        </div>

                    </div>

                    <div rel="yui:events" resource="#events">


                    </div>

                    <div rel="yui:attributes" resource="#configattributes">

                    </div>

			</div>
		</div>
		<div class="yui-b">
            <div class="nav">

                    <div id="moduleList" class="module">
                        <h4>Modules</h4>
                        <ul class="content">
                                <li class=""><a href="module_anim.html" title="anim">anim</a></li>
                                <li class=""><a href="module_async-queue.html" title="async-queue">async-queue</a></li>
                                <li class="selected"><a href="module_attribute.html" title="attribute">attribute</a></li>
                                <li class=""><a href="module_base.html" title="base">base</a></li>
                                <li class=""><a href="module_cache.html" title="cache">cache</a></li>
                                <li class=""><a href="module_classnamemanager.html" title="classnamemanager">classnamemanager</a></li>
                                <li class=""><a href="module_collection.html" title="collection">collection</a></li>
                                <li class=""><a href="module_console.html" title="console">console</a></li>
                                <li class=""><a href="module_console-filters.html" title="console-filters">console-filters</a></li>
                                <li class=""><a href="module_cookie.html" title="cookie">cookie</a></li>
                                <li class=""><a href="module_dataschema.html" title="dataschema">dataschema</a></li>
                                <li class=""><a href="module_datasource.html" title="datasource">datasource</a></li>
                                <li class=""><a href="module_datatype.html" title="datatype">datatype</a></li>
                                <li class=""><a href="module_dd.html" title="dd">dd</a></li>
                                <li class=""><a href="module_dom.html" title="dom">dom</a></li>
                                <li class=""><a href="module_dump.html" title="dump">dump</a></li>
                                <li class=""><a href="module_event.html" title="event">event</a></li>
                                <li class=""><a href="module_event-custom.html" title="event-custom">event-custom</a></li>
                                <li class=""><a href="module_event-simulate.html" title="event-simulate">event-simulate</a></li>
                                <li class=""><a href="module_history.html" title="history">history</a></li>
                                <li class=""><a href="module_imageloader.html" title="imageloader">imageloader</a></li>
                                <li class=""><a href="module_io.html" title="io">io</a></li>
                                <li class=""><a href="module_json.html" title="json">json</a></li>
                                <li class=""><a href="module_node.html" title="node">node</a></li>
                                <li class=""><a href="module_node-focusmanager.html" title="node-focusmanager">node-focusmanager</a></li>
                                <li class=""><a href="module_node-menunav.html" title="node-menunav">node-menunav</a></li>
                                <li class=""><a href="module_oop.html" title="oop">oop</a></li>
                                <li class=""><a href="module_overlay.html" title="overlay">overlay</a></li>
                                <li class=""><a href="module_plugin.html" title="plugin">plugin</a></li>
                                <li class=""><a href="module_profiler.html" title="profiler">profiler</a></li>
                                <li class=""><a href="module_queue-promote.html" title="queue-promote">queue-promote</a></li>
                                <li class=""><a href="module_slider.html" title="slider">slider</a></li>
                                <li class=""><a href="module_stylesheet.html" title="stylesheet">stylesheet</a></li>
                                <li class=""><a href="module_substitute.html" title="substitute">substitute</a></li>
                                <li class=""><a href="module_test.html" title="test">test</a></li>
                                <li class=""><a href="module_widget.html" title="widget">widget</a></li>
                                <li class=""><a href="module_widget-position.html" title="widget-position">widget-position</a></li>
                                <li class=""><a href="module_widget-position-ext.html" title="widget-position-ext">widget-position-ext</a></li>
                                <li class=""><a href="module_widget-stack.html" title="widget-stack">widget-stack</a></li>
                                <li class=""><a href="module_widget-stdmod.html" title="widget-stdmod">widget-stdmod</a></li>
                                <li class=""><a href="module_yui.html" title="yui">yui</a></li>
                        </ul>
                    </div>

                    <div id="classList" class="module">
                        <h4>Classes</h4>
                        <ul class="content">
                                <li class=""><a href="Attribute.html" title="Attribute">Attribute</a></li>
                                <li class="selected"><a href="State.html" title="State">State</a></li>
                        </ul>
                    </div>

                    <div id="fileList" class="module">
                        <h4>Files</h4>
                        <ul class="content">        
                                <li class=""><a href="Attribute.js.html" title="Attribute.js">Attribute.js</a></li>
                                <li class=""><a href="ComplexAttribute.js.html" title="ComplexAttribute.js">ComplexAttribute.js</a></li>
                                <li class=""><a href="State.js.html" title="State.js">State.js</a></li>
                        </ul>
                    </div>

                    <div id="propertyList" class="module">
                        <h4>Properties</h4>
                        <ul class="content">        
                                <li class=""><a href="#property_data" title="data">data</a></li>
                        </ul>
                    </div>

                    <div id="methodsList" class="module">
                        <h4>Methods</h4>
                        <ul class="content">        
                                <li class=""><a href="#method_add" title="add">add</a></li>
                                <li class=""><a href="#method_addAll" title="addAll">addAll</a></li>
                                <li class=""><a href="#method_get" title="get">get</a></li>
                                <li class=""><a href="#method_getAll" title="getAll">getAll</a></li>
                                <li class=""><a href="#method_remove" title="remove">remove</a></li>
                                <li class=""><a href="#method_removeAll" title="removeAll">removeAll</a></li>
                        </ul>
                    </div>



            </div>
		</div>
	</div>
	<div id="ft">
        <hr />
        Copyright &copy; 2009 Yahoo! Inc. All rights reserved.
	</div>
</div>
<script type="text/javascript">
    ALL_YUI_PROPS = [{"access": "", "host": "State", "name": "add", "url": "State.html#method_add", "type": "method"}, {"access": "", "host": "State", "name": "addAll", "url": "State.html#method_addAll", "type": "method"}, {"access": "", "host": "Attribute", "name": "addAttr", "url": "Attribute.html#method_addAttr", "type": "method"}, {"access": "private", "host": "Attribute", "name": "_addAttrs", "url": "Attribute.html#method__addAttrs", "type": "method"}, {"access": "", "host": "Attribute", "name": "addAttrs", "url": "Attribute.html#method_addAttrs", "type": "method"}, {"access": "private", "host": "Attribute", "name": "_addLazyAttr", "url": "Attribute.html#method__addLazyAttr", "type": "method"}, {"access": "", "host": "Attribute", "name": "attrAdded", "url": "Attribute.html#method_attrAdded", "type": "method"}, {"access": "protected", "host": "Attribute", "name": "Attribute._ATTR_CFG", "url": "Attribute.html#property_Attribute._ATTR_CFG", "type": "property"}, {"access": "", "host": "Attribute", "name": "Attribute.INVALID_VALUE", "url": "Attribute.html#property_Attribute.INVALID_VALUE", "type": "property"}, {"access": "", "host": "State", "name": "data", "url": "State.html#property_data", "type": "property"}, {"access": "private", "host": "Attribute", "name": "_defAttrChangeFn", "url": "Attribute.html#method__defAttrChangeFn", "type": "method"}, {"access": "private", "host": "Attribute", "name": "_fireAttrChange", "url": "Attribute.html#method__fireAttrChange", "type": "method"}, {"access": "", "host": "Attribute", "name": "get", "url": "Attribute.html#method_get", "type": "method"}, {"access": "", "host": "State", "name": "get", "url": "State.html#method_get", "type": "method"}, {"access": "", "host": "State", "name": "getAll", "url": "State.html#method_getAll", "type": "method"}, {"access": "protected", "host": "Attribute", "name": "_getAttr", "url": "Attribute.html#method__getAttr", "type": "method"}, {"access": "private", "host": "Attribute", "name": "_getAttrInitVal", "url": "Attribute.html#method__getAttrInitVal", "type": "method"}, {"access": "protected", "host": "Attribute", "name": "_getAttrs", "url": "Attribute.html#method__getAttrs", "type": "method"}, {"access": "", "host": "Attribute", "name": "getAttrs", "url": "Attribute.html#method_getAttrs", "type": "method"}, {"access": "private", "host": "Attribute", "name": "_getStateVal", "url": "Attribute.html#method__getStateVal", "type": "method"}, {"access": "private", "host": "Attribute", "name": "_isLazyAttr", "url": "Attribute.html#method__isLazyAttr", "type": "method"}, {"access": "", "host": "Attribute", "name": "modifyAttr", "url": "Attribute.html#method_modifyAttr", "type": "method"}, {"access": "private", "host": "Attribute", "name": "_normAttrVals", "url": "Attribute.html#method__normAttrVals", "type": "method"}, {"access": "protected", "host": "Attribute", "name": "_protectAttrs", "url": "Attribute.html#method__protectAttrs", "type": "method"}, {"access": "", "host": "State", "name": "remove", "url": "State.html#method_remove", "type": "method"}, {"access": "", "host": "State", "name": "removeAll", "url": "State.html#method_removeAll", "type": "method"}, {"access": "", "host": "Attribute", "name": "removeAttr", "url": "Attribute.html#method_removeAttr", "type": "method"}, {"access": "", "host": "Attribute", "name": "reset", "url": "Attribute.html#method_reset", "type": "method"}, {"access": "protected", "host": "Attribute", "name": "_set", "url": "Attribute.html#method__set", "type": "method"}, {"access": "", "host": "Attribute", "name": "set", "url": "Attribute.html#method_set", "type": "method"}, {"access": "protected", "host": "Attribute", "name": "_setAttr", "url": "Attribute.html#method__setAttr", "type": "method"}, {"access": "protected", "host": "Attribute", "name": "_setAttrs", "url": "Attribute.html#method__setAttrs", "type": "method"}, {"access": "", "host": "Attribute", "name": "setAttrs", "url": "Attribute.html#method_setAttrs", "type": "method"}, {"access": "private", "host": "Attribute", "name": "_setAttrVal", "url": "Attribute.html#method__setAttrVal", "type": "method"}, {"access": "private", "host": "Attribute", "name": "_setStateVal", "url": "Attribute.html#method__setStateVal", "type": "method"}];
</script>
</body>
</html>