<!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: yui Object (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>yui <span class="subtitle">3.0.0</span></h3>
<a href="./index.html" title="Yahoo! UI Library">Yahoo! UI Library</a>
> <a href="./module_yui.html" title="yui">yui</a>
> Object
<form onsubmit="return false">
<div id="propertysearch">
Search: <input autocomplete="off" id="searchinput" />
<div id="searchresults">
</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">Object</b>
<span class="extends">
</span>
</h2>
<!-- class tree goes here -->
<div class="summary description" property="yui:description">
Adds the following Object utilities to the YUI instance
</div>
<div rel="yui:properties" resource="#properties">
</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_()">
<h4>
<a name="method_()">()</a></h4>
<div class="detail" >
<code>
static
Object
<strong property="yui:name">()</strong>
(
o
)
</code>
<div class="description" property="yui:description">
Y.Object(o) returns a new object based upon the supplied object.
</div>
<div class="description">
<dl rel="yui:parameters">
<dt>Parameters:</dt>
<dd rel="yui:parameter">
<code><span property="yui:name">o</span>
<<span property="yui:type">object</span>>
</code>
<span property="yui:description"> the supplier object</span>
</dd>
</dl>
<dl>
<dt>Returns:
<code property="yui:return">
Object
</code></dt>
<dd property="yui:returnInfo">the new object</dd>
</dl>
</div>
</div>
<hr />
</div>
<div class="private" rel="yui:method" resource="#method__extract">
<h4>
<a name="method__extract">_extract</a></h4>
<div class="detail" >
<code>
private
static
boolean|Array
<strong property="yui:name">_extract</strong>
(
o
,
what
)
</code>
<div class="description" property="yui:description">
Extracts the keys, values, or size from an object
</div>
<div class="description">
<dl rel="yui:parameters">
<dt>Parameters:</dt>
<dd rel="yui:parameter">
<code><span property="yui:name">o</span>
<<span property="yui:type">object</span>>
</code>
<span property="yui:description"> the object</span>
</dd>
<dd rel="yui:parameter">
<code><span property="yui:name">what</span>
<<span property="yui:type">object</span>>
</code>
<span property="yui:description"> what to extract (0: keys, 1: values, 2: size)</span>
</dd>
</dl>
<dl>
<dt>Returns:
<code property="yui:return">
boolean|Array
</code></dt>
<dd property="yui:returnInfo">the extracted info</dd>
</dl>
</div>
</div>
<hr />
</div>
<div class="" rel="yui:method" resource="#method_each">
<h4>
<a name="method_each">each</a></h4>
<div class="detail" >
<code>
static
YUI
<strong property="yui:name">each</strong>
(
o
,
f
,
c
,
proto
)
</code>
<div class="description" property="yui:description">
Executes a function on each item. The function
receives the value, the key, and the object
as paramters (in that order).
</div>
<div class="description">
<dl rel="yui:parameters">
<dt>Parameters:</dt>
<dd rel="yui:parameter">
<code><span property="yui:name">o</span>
<<span property="yui:type">object</span>>
</code>
<span property="yui:description"> the object to iterate</span>
</dd>
<dd rel="yui:parameter">
<code><span property="yui:name">f</span>
<<span property="yui:type">Function</span>>
</code>
<span property="yui:description"> the function to execute on each item. The function
receives three arguments: the value, the the key, the full object.</span>
</dd>
<dd rel="yui:parameter">
<code><span property="yui:name">c</span>
<<span property="yui:type">object</span>>
</code>
<span property="yui:description"> the execution context</span>
</dd>
<dd rel="yui:parameter">
<code><span property="yui:name">proto</span>
<<span property="yui:type">boolean</span>>
</code>
<span property="yui:description"> include proto</span>
</dd>
</dl>
<dl>
<dt>Returns:
<code property="yui:return">
YUI
</code></dt>
<dd property="yui:returnInfo">the YUI instance</dd>
</dl>
</div>
</div>
<hr />
</div>
<div class="" rel="yui:method" resource="#method_getValue">
<h4>
<a name="method_getValue">getValue</a></h4>
<div class="detail" >
<code>
Any
<strong property="yui:name">getValue</strong>
(
o
,
path
)
</code>
<div class="description" property="yui:description">
Retrieves the sub value at the provided path,
from the value object provided.
</div>
<div class="description">
<dl rel="yui:parameters">
<dt>Parameters:</dt>
<dd rel="yui:parameter">
<code><span property="yui:name">o</span>
<<span property="yui:type">object</span>>
</code>
<span property="yui:description"> The object from which to extract the property value</span>
</dd>
<dd rel="yui:parameter">
<code><span property="yui:name">path</span>
<<span property="yui:type">Array</span>>
</code>
<span property="yui:description"> A path array, specifying the object traversal path
from which to obtain the sub value.</span>
</dd>
</dl>
<dl>
<dt>Returns:
<code property="yui:return">
Any
</code></dt>
<dd property="yui:returnInfo">The value stored in the path, undefined if not found.
Returns the source object if an empty path is provided.</dd>
</dl>
</div>
</div>
<hr />
</div>
<div class="" rel="yui:method" resource="#method_hasKey">
<h4>
<a name="method_hasKey">hasKey</a></h4>
<div class="detail" >
<code>
static
boolean
<strong property="yui:name">hasKey</strong>
(
o
,
k
)
</code>
<div class="description" property="yui:description">
Returns true if the object contains a given key
</div>
<div class="description">
<dl rel="yui:parameters">
<dt>Parameters:</dt>
<dd rel="yui:parameter">
<code><span property="yui:name">o</span>
<<span property="yui:type">object</span>>
</code>
<span property="yui:description"> an object</span>
</dd>
<dd rel="yui:parameter">
<code><span property="yui:name">k</span>
<<span property="yui:type">object</span>>
</code>
<span property="yui:description"> the key to query</span>
</dd>
</dl>
<dl>
<dt>Returns:
<code property="yui:return">
boolean
</code></dt>
<dd property="yui:returnInfo">true if the object contains the key</dd>
</dl>
</div>
</div>
<hr />
</div>
<div class="" rel="yui:method" resource="#method_hasValue">
<h4>
<a name="method_hasValue">hasValue</a></h4>
<div class="detail" >
<code>
static
boolean
<strong property="yui:name">hasValue</strong>
(
o
,
v
)
</code>
<div class="description" property="yui:description">
Returns true if the object contains a given value
</div>
<div class="description">
<dl rel="yui:parameters">
<dt>Parameters:</dt>
<dd rel="yui:parameter">
<code><span property="yui:name">o</span>
<<span property="yui:type">object</span>>
</code>
<span property="yui:description"> an object</span>
</dd>
<dd rel="yui:parameter">
<code><span property="yui:name">v</span>
<<span property="yui:type">object</span>>
</code>
<span property="yui:description"> the value to query</span>
</dd>
</dl>
<dl>
<dt>Returns:
<code property="yui:return">
boolean
</code></dt>
<dd property="yui:returnInfo">true if the object contains the value</dd>
</dl>
</div>
</div>
<hr />
</div>
<div class="" rel="yui:method" resource="#method_keys">
<h4>
<a name="method_keys">keys</a></h4>
<div class="detail" >
<code>
static
string[]
<strong property="yui:name">keys</strong>
(
o
)
</code>
<div class="description" property="yui:description">
Returns an array containing the object's keys
</div>
<div class="description">
<dl rel="yui:parameters">
<dt>Parameters:</dt>
<dd rel="yui:parameter">
<code><span property="yui:name">o</span>
<<span property="yui:type">object</span>>
</code>
<span property="yui:description"> an object</span>
</dd>
</dl>
<dl>
<dt>Returns:
<code property="yui:return">
string[]
</code></dt>
<dd property="yui:returnInfo">the keys</dd>
</dl>
</div>
</div>
<hr />
</div>
<div class=" deprecated" rel="yui:method" resource="#method_owns">
<h4>
<a name="method_owns">owns</a></h4>
<div class="detail" >
<code>
static
boolean
<strong property="yui:name">owns</strong>
(
o
,
p
)
</code>
<div class="description" property="yui:description">
Determines whether or not the property was added
to the object instance. Returns false if the property is not present
in the object, or was inherited from the prototype.
</div>
<div class="description">
<dl rel="yui:parameters">
<dt>Parameters:</dt>
<dd rel="yui:parameter">
<code><span property="yui:name">o</span>
<<span property="yui:type">any</span>>
</code>
<span property="yui:description"> The object being testing</span>
</dd>
<dd rel="yui:parameter">
<code><span property="yui:name">p</span>
<<span property="yui:type">string</span>>
</code>
<span property="yui:description"> the property to look for</span>
</dd>
</dl>
<dl>
<dt>Returns:
<code property="yui:return">
boolean
</code></dt>
<dd property="yui:returnInfo">true if the object has the property on the instance</dd>
</dl>
<div class="deprecated">
<strong>Deprecated</strong> Safari 1.x support has been removed, so this is simply a
wrapper for the native implementation. Use the native implementation
directly instead.
</div>
</div>
</div>
<hr />
</div>
<div class="" rel="yui:method" resource="#method_setValue">
<h4>
<a name="method_setValue">setValue</a></h4>
<div class="detail" >
<code>
Object
<strong property="yui:name">setValue</strong>
(
o
,
path
,
val
)
</code>
<div class="description" property="yui:description">
Sets the sub-attribute value at the provided path on the
value object. Returns the modified value object, or
undefined if the path is invalid.
</div>
<div class="description">
<dl rel="yui:parameters">
<dt>Parameters:</dt>
<dd rel="yui:parameter">
<code><span property="yui:name">o</span>
<<span property="yui:type">object</span>>
</code>
<span property="yui:description"> The object on which to set the sub value.</span>
</dd>
<dd rel="yui:parameter">
<code><span property="yui:name">path</span>
<<span property="yui:type">Array</span>>
</code>
<span property="yui:description"> A path array, specifying the object traversal path
at which to set the sub value.</span>
</dd>
<dd rel="yui:parameter">
<code><span property="yui:name">val</span>
<<span property="yui:type">Any</span>>
</code>
<span property="yui:description"> The new value for the sub-attribute.</span>
</dd>
</dl>
<dl>
<dt>Returns:
<code property="yui:return">
Object
</code></dt>
<dd property="yui:returnInfo">The modified object, with the new sub value set, or
undefined, if the path was invalid.</dd>
</dl>
</div>
</div>
<hr />
</div>
<div class="" rel="yui:method" resource="#method_size">
<h4>
<a name="method_size">size</a></h4>
<div class="detail" >
<code>
static
int
<strong property="yui:name">size</strong>
(
o
)
</code>
<div class="description" property="yui:description">
Returns the size of an object
</div>
<div class="description">
<dl rel="yui:parameters">
<dt>Parameters:</dt>
<dd rel="yui:parameter">
<code><span property="yui:name">o</span>
<<span property="yui:type">object</span>>
</code>
<span property="yui:description"> an object</span>
</dd>
</dl>
<dl>
<dt>Returns:
<code property="yui:return">
int
</code></dt>
<dd property="yui:returnInfo">the size</dd>
</dl>
</div>
</div>
<hr />
</div>
<div class="" rel="yui:method" resource="#method_values">
<h4>
<a name="method_values">values</a></h4>
<div class="detail" >
<code>
static
Array
<strong property="yui:name">values</strong>
(
o
)
</code>
<div class="description" property="yui:description">
Returns an array containing the object's values
</div>
<div class="description">
<dl rel="yui:parameters">
<dt>Parameters:</dt>
<dd rel="yui:parameter">
<code><span property="yui:name">o</span>
<<span property="yui:type">object</span>>
</code>
<span property="yui:description"> an object</span>
</dd>
</dl>
<dl>
<dt>Returns:
<code property="yui:return">
Array
</code></dt>
<dd property="yui:returnInfo">the values</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=""><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="selected"><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="Array.html" title="Array">Array</a></li>
<li class=""><a href="config.html" title="config">config</a></li>
<li class=""><a href="Get.html" title="Get">Get</a></li>
<li class=""><a href="Lang.html" title="Lang">Lang</a></li>
<li class="selected"><a href="Object.html" title="Object">Object</a></li>
<li class=""><a href="Queue.html" title="Queue">Queue</a></li>
<li class=""><a href="UA.html" title="UA">UA</a></li>
<li class=""><a href="YUI.html" title="YUI">YUI</a></li>
</ul>
</div>
<div id="fileList" class="module">
<h4>Files</h4>
<ul class="content">
<li class=""><a href="_module.js.html" title="_module.js">_module.js</a></li>
<li class=""><a href="get.js.html" title="get.js">get.js</a></li>
<li class=""><a href="queue-base.js.html" title="queue-base.js">queue-base.js</a></li>
<li class=""><a href="yui-array.js.html" title="yui-array.js">yui-array.js</a></li>
<li class=""><a href="yui-base.js.html" title="yui-base.js">yui-base.js</a></li>
<li class=""><a href="yui-core.js.html" title="yui-core.js">yui-core.js</a></li>
<li class=""><a href="yui-init.js.html" title="yui-init.js">yui-init.js</a></li>
<li class=""><a href="yui-lang.js.html" title="yui-lang.js">yui-lang.js</a></li>
<li class=""><a href="yui-later.js.html" title="yui-later.js">yui-later.js</a></li>
<li class=""><a href="yui-log.js.html" title="yui-log.js">yui-log.js</a></li>
<li class=""><a href="yui-object.js.html" title="yui-object.js">yui-object.js</a></li>
<li class=""><a href="yui-ua.js.html" title="yui-ua.js">yui-ua.js</a></li>
<li class=""><a href="yui.js.html" title="yui.js">yui.js</a></li>
</ul>
</div>
<div id="methodsList" class="module">
<h4>Methods</h4>
<ul class="content">
<li class=""><a href="#method_()" title="()">()</a></li>
<li class="private"><a href="#method__extract" title="_extract">_extract</a></li>
<li class=""><a href="#method_each" title="each">each</a></li>
<li class=""><a href="#method_getValue" title="getValue">getValue</a></li>
<li class=""><a href="#method_hasKey" title="hasKey">hasKey</a></li>
<li class=""><a href="#method_hasValue" title="hasValue">hasValue</a></li>
<li class=""><a href="#method_keys" title="keys">keys</a></li>
<li class=" deprecated"><a href="#method_owns" title="owns">owns</a></li>
<li class=""><a href="#method_setValue" title="setValue">setValue</a></li>
<li class=""><a href="#method_size" title="size">size</a></li>
<li class=""><a href="#method_values" title="values">values</a></li>
</ul>
</div>
</div>
</div>
</div>
<div id="ft">
<hr />
Copyright © 2009 Yahoo! Inc. All rights reserved.
</div>
</div>
<script type="text/javascript">
ALL_YUI_PROPS = [{"access": "", "host": "Object", "name": "()", "url": "Object.html#method_()", "type": "method"}, {"access": "", "host": "Object", "name": "each", "url": "Object.html#method_each", "type": "method"}, {"access": "private", "host": "Object", "name": "_extract", "url": "Object.html#method__extract", "type": "method"}, {"access": "", "host": "Object", "name": "getValue", "url": "Object.html#method_getValue", "type": "method"}, {"access": "", "host": "Object", "name": "hasKey", "url": "Object.html#method_hasKey", "type": "method"}, {"access": "", "host": "Object", "name": "hasValue", "url": "Object.html#method_hasValue", "type": "method"}, {"access": "", "host": "Object", "name": "keys", "url": "Object.html#method_keys", "type": "method"}, {"access": "", "host": "Object", "name": "owns", "url": "Object.html#method_owns", "type": "method"}, {"access": "", "host": "Object", "name": "setValue", "url": "Object.html#method_setValue", "type": "method"}, {"access": "", "host": "Object", "name": "size", "url": "Object.html#method_size", "type": "method"}, {"access": "", "host": "Object", "name": "values", "url": "Object.html#method_values", "type": "method"}];
</script>
</body>
</html>