-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathcola.util.KeyedArray.html
4 lines (4 loc) · 23.4 KB
/
cola.util.KeyedArray.html
1
2
3
4
<!DOCTYPE html><html><head><title>cola.util.KeyedArray</title><meta charset="utf-8"><meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1, maximum-scale=1"><link rel="stylesheet" type="text/css" href="./resources/css.css"><link rel="stylesheet" type="text/css" href="./resources/doc.css"></head><body class="v-box"><div class="ui inverted menu doc-header box"><div class="ui header item">Cola UI API-v1.0.9</div><div class="right menu"><a id="showSidebarBtn" class="item"><i class="content icon"></i></a></div></div><div class="flex-box"><div class="row doc-body"><div id="toc" class="medium-3 large-2 columns"><div class="ui icon input fluid inverted transparent"><input id="searchInput" type="text" placeholder="搜索..."><i class="search icon"></i></div><div class="ui list"><a href="./$.html" class="item data-item">$</a><a href="./cola.html" class="item data-item">cola</a><a href="./cola.AbstractButton.html" class="item data-item">cola.AbstractButton</a><a href="./cola.AbstractCheckbox.html" class="item data-item">cola.AbstractCheckbox</a><a href="./cola.AbstractContainer.html" class="item data-item">cola.AbstractContainer</a><a href="./cola.AbstractDropdown.html" class="item data-item">cola.AbstractDropdown</a><a href="./cola.AbstractEditor.html" class="item data-item">cola.AbstractEditor</a><a href="./cola.AbstractInput.html" class="item data-item">cola.AbstractInput</a><a href="./cola.AbstractItemGroup.html" class="item data-item">cola.AbstractItemGroup</a><a href="./cola.AbstractList.html" class="item data-item">cola.AbstractList</a><a href="./cola.AbstractMenuItem.html" class="item data-item">cola.AbstractMenuItem</a><a href="./cola.AbstractSlotList.html" class="item data-item">cola.AbstractSlotList</a><a href="./cola.AjaxValidator.html" class="item data-item">cola.AjaxValidator</a><a href="./cola.AsyncValidator.html" class="item data-item">cola.AsyncValidator</a><a href="./cola.Avatar.html" class="item data-item">cola.Avatar</a><a href="./cola.Breadcrumb.html" class="item data-item">cola.Breadcrumb</a><a href="./cola.Button.html" class="item data-item">cola.Button</a><a href="./cola.ButtonGroup.html" class="item data-item">cola.ButtonGroup</a><a href="./cola.Calendar.html" class="item data-item">cola.Calendar</a><a href="./cola.CardBook.html" class="item data-item">cola.CardBook</a><a href="./cola.Carousel.html" class="item data-item">cola.Carousel</a><a href="./cola.CascadeBind.html" class="item data-item">cola.CascadeBind</a><a href="./cola.Checkbox.html" class="item data-item">cola.Checkbox</a><a href="./cola.ControlMenuItem.html" class="item data-item">cola.ControlMenuItem</a><a href="./cola.Corner.html" class="item data-item">cola.Corner</a><a href="./cola.CustomDropdown.html" class="item data-item">cola.CustomDropdown</a><a href="./cola.CustomValidator.html" class="item data-item">cola.CustomValidator</a><a href="./cola.DataType.html" class="item data-item">cola.DataType</a><a href="./cola.DatePicker.html" class="item data-item">cola.DatePicker</a><a href="./cola.DateTimePicker.html" class="item data-item">cola.DateTimePicker</a><a href="./cola.Definition.html" class="item data-item">cola.Definition</a><a href="./cola.Dialog.html" class="item data-item">cola.Dialog</a><a href="./cola.Divider.html" class="item data-item">cola.Divider</a><a href="./cola.Dropdown.html" class="item data-item">cola.Dropdown</a><a href="./cola.DropdownMenuItem.html" class="item data-item">cola.DropdownMenuItem</a><a href="./cola.Element.html" class="item data-item">cola.Element</a><a href="./cola.EmailValidator.html" class="item data-item">cola.EmailValidator</a><a href="./cola.Entity.html" class="item data-item">cola.Entity</a><a href="./cola.EntityDataType.html" class="item data-item">cola.EntityDataType</a><a href="./cola.EntityList.html" class="item data-item">cola.EntityList</a><a href="./cola.FieldSet.html" class="item data-item">cola.FieldSet</a><a href="./cola.GroupBox.html" class="item data-item">cola.GroupBox</a><a href="./cola.HeaderMenuItem.html" class="item data-item">cola.HeaderMenuItem</a><a href="./cola.IFrame.html" class="item data-item">cola.IFrame</a><a href="./cola.Image.html" class="item data-item">cola.Image</a><a href="./cola.Input.html" class="item data-item">cola.Input</a><a href="./cola.ItemsView.html" class="item data-item">cola.ItemsView</a><a href="./cola.Label.html" class="item data-item">cola.Label</a><a href="./cola.Layer.html" class="item data-item">cola.Layer</a><a href="./cola.LengthValidator.html" class="item data-item">cola.LengthValidator</a><a href="./cola.Link.html" class="item data-item">cola.Link</a><a href="./cola.ListView.html" class="item data-item">cola.ListView</a><a href="./cola.Menu.html" class="item data-item">cola.Menu</a><a href="./cola.MenuButton.html" class="item data-item">cola.MenuButton</a><a href="./cola.MenuItem.html" class="item data-item">cola.MenuItem</a><a href="./cola.Model.html" class="item data-item">cola.Model</a><a href="./cola.MultiSlotPicker.html" class="item data-item">cola.MultiSlotPicker</a><a href="./cola.NestedList.html" class="item data-item">cola.NestedList</a><a href="./cola.NestedListBind.html" class="item data-item">cola.NestedListBind</a><a href="./cola.NestedListNode.html" class="item data-item">cola.NestedListNode</a><a href="./cola.Node.html" class="item data-item">cola.Node</a><a href="./cola.NotifyTipManager.html" class="item data-item">cola.NotifyTipManager</a><a href="./cola.NumberValidator.html" class="item data-item">cola.NumberValidator</a><a href="./cola.Pager.html" class="item data-item">cola.Pager</a><a href="./cola.Panel.html" class="item data-item">cola.Panel</a><a href="./cola.PointingLabel.html" class="item data-item">cola.PointingLabel</a><a href="./cola.Progress.html" class="item data-item">cola.Progress</a><a href="./cola.Property.html" class="item data-item">cola.Property</a><a href="./cola.Provider.html" class="item data-item">cola.Provider</a><a href="./cola.RadioButton.html" class="item data-item">cola.RadioButton</a><a href="./cola.RadioGroup.html" class="item data-item">cola.RadioGroup</a><a href="./cola.RangeSlotList.html" class="item data-item">cola.RangeSlotList</a><a href="./cola.Rating.html" class="item data-item">cola.Rating</a><a href="./cola.RegExpValidator.html" class="item data-item">cola.RegExpValidator</a><a href="./cola.RenderableElement.html" class="item data-item">cola.RenderableElement</a><a href="./cola.RequiredValidator.html" class="item data-item">cola.RequiredValidator</a><a href="./cola.Reveal.html" class="item data-item">cola.Reveal</a><a href="./cola.Ribbon.html" class="item data-item">cola.Ribbon</a><a href="./cola.Segment.html" class="item data-item">cola.Segment</a><a href="./cola.Select.html" class="item data-item">cola.Select</a><a href="./cola.Sidebar.html" class="item data-item">cola.Sidebar</a><a href="./cola.Slider.html" class="item data-item">cola.Slider</a><a href="./cola.SlotList.html" class="item data-item">cola.SlotList</a><a href="./cola.SplitPane.html" class="item data-item">cola.SplitPane</a><a href="./cola.Stack.html" class="item data-item">cola.Stack</a><a href="./cola.Steps.html" class="item data-item">cola.Steps</a><a href="./cola.SubView.html" class="item data-item">cola.SubView</a><a href="./cola.Tab.html" class="item data-item">cola.Tab</a><a href="./cola.TabButton.html" class="item data-item">cola.TabButton</a><a href="./cola.Table.html" class="item data-item">cola.Table</a><a href="./cola.TableColumn.html" class="item data-item">cola.TableColumn</a><a href="./cola.TableContentColumn.html" class="item data-item">cola.TableContentColumn</a><a href="./cola.TableDataColumn.html" class="item data-item">cola.TableDataColumn</a><a href="./cola.TableGroupColumn.html" class="item data-item">cola.TableGroupColumn</a><a href="./cola.TableSelectColumn.html" class="item data-item">cola.TableSelectColumn</a><a href="./cola.Tag.html" class="item data-item">cola.Tag</a><a href="./cola.TimeLine.html" class="item data-item">cola.TimeLine</a><a href="./cola.TitleBar.html" class="item data-item">cola.TitleBar</a><a href="./cola.Toggle.html" class="item data-item">cola.Toggle</a><a href="./cola.Tree.html" class="item data-item">cola.Tree</a><a href="./cola.TreeNode.html" class="item data-item">cola.TreeNode</a><a href="./cola.TreeNodeBind.html" class="item data-item">cola.TreeNodeBind</a><a href="./cola.UrlValidator.html" class="item data-item">cola.UrlValidator</a><a href="./cola.Validator.html" class="item data-item">cola.Validator</a><a href="./cola.Widget.html" class="item data-item">cola.Widget</a><a href="./cola.breadcrumb.Section.html" class="item data-item">cola.breadcrumb.Section</a><a href="./cola.browser.html" class="item data-item">cola.browser</a><a href="./cola.buttonGroup.Separator.html" class="item data-item">cola.buttonGroup.Separator</a><a href="./cola.contants.html" class="item data-item">cola.contants</a><a href="./cola.defaultAction.html" class="item data-item">cola.defaultAction</a><a href="./cola.device.html" class="item data-item">cola.device</a><a href="./cola.os.html" class="item data-item">cola.os</a><a href="./cola.steps.Step.html" class="item data-item">cola.steps.Step</a><a href="./cola.tab.AbstractTabButton.html" class="item data-item">cola.tab.AbstractTabButton</a><a href="./cola.util.html" class="item data-item">cola.util</a><a href="./cola.util.KeyedArray.html" class="item data-item active">cola.util.KeyedArray</a></div></div><div id="doc-content" class="small-12 medium-9 large-10 columns"><div style="height:100%" class="v-box"><div class="box"><h2 class="ui header">cola.util.KeyedArray</h2><div class="intro"><div class="sub header">KeyedArray</div><div class="description"><p>KeyedArray的作用类似于一个有序的Map表,他可以以有序的方式管理一组键值对。
</p></div></div><div class="ui pointing secondary menu"><a data-tab="properties" class="item active">Properties</a><a data-tab="methods" class="item">Methods</a></div></div><div class="flex-box"><div><div data-tab="properties" class="ui tab active"><div class="ui properties"><div class="item"><div data-key="size" class="item-header"><strong>size</strong><div class="type">number</div><em><a href="./undefined.html"><code></code></a></em></div><div class="item-body"><div class="label">集合中的元素数</div><pre class="description"></pre></div></div></div></div><div data-tab="methods" class="ui tab"><div class="ui methods"><div class="item"><div class="item-header"><strong>add</strong><span class="label">添加一个键值对</span><em><a href="./cola.util.KeyedArray.html"><code>cola.util.KeyedArray</code></a></em></div><div class="item-body"><div class="parameters"><div class="label">Parameters:</div><ul><li class="param"><span class="name ui label mini horizontal">key</span><span class="type">string</span><p class="desc">键值</p></li><li class="param"><span class="name ui label mini horizontal">element</span><span class="type">any</span><p class="desc">值</p></li></ul></div><div class="return"><span class="label">Returns:</span><span class="type">cola.util.KeyedArray</span></div><pre class="description"></pre></div></div><div class="item"><div class="item-header"><strong>remove</strong><span class="label">删除一个键值对</span><em><a href="./cola.util.KeyedArray.html"><code>cola.util.KeyedArray</code></a></em></div><div class="item-body"><div class="parameters"><div class="label">Parameters:</div><ul><li class="param"><span class="name ui label mini horizontal">key</span><span class="type">string || number</span><p class="desc">键值或序号(从0开始)</p></li></ul></div><div class="return"><span class="label">Returns:</span><span class="type">any</span></div><pre class="description"></pre></div></div><div class="item"><div class="item-header"><strong>get</strong><span class="label">返回一个值</span><em><a href="./cola.util.KeyedArray.html"><code>cola.util.KeyedArray</code></a></em></div><div class="item-body"><div class="parameters"><div class="label">Parameters:</div><ul><li class="param"><span class="name ui label mini horizontal">key</span><span class="type">string || number</span><p class="desc">键值或序号(从0开始)</p></li></ul></div><div class="return"><span class="label">Returns:</span><span class="type">any</span></div><pre class="description"></pre></div></div><div class="item"><div class="item-header"><strong>getIndex</strong><span class="label">根据键值返回其在集合中的序号(从0开始)</span><em><a href="./cola.util.KeyedArray.html"><code>cola.util.KeyedArray</code></a></em></div><div class="item-body"><div class="parameters"><div class="label">Parameters:</div><ul><li class="param"><span class="name ui label mini horizontal">key</span><span class="type">string</span><p class="desc">键值</p></li></ul></div><div class="return"><span class="label">Returns:</span><span class="type">number</span></div><pre class="description"></pre></div></div><div class="item"><div class="item-header"><strong>clear</strong><span class="label">清空集合</span><em><a href="./cola.util.KeyedArray.html"><code>cola.util.KeyedArray</code></a></em></div><div class="item-body"><div class="return"><span class="label">Returns:</span><span class="type">cola.util.KeyedArray</span></div><pre class="description"></pre></div></div><div class="item"><div class="item-header"><strong>elements</strong><span class="label">返回包含所有值的数组</span><em><a href="./cola.util.KeyedArray.html"><code>cola.util.KeyedArray</code></a></em></div><div class="item-body"><div class="return"><span class="label">Returns:</span><span class="type">any</span></div><pre class="description"></pre></div></div><div class="item"><div class="item-header"><strong>each</strong><span class="label">迭代所有键值对</span><em><a href="./cola.util.KeyedArray.html"><code>cola.util.KeyedArray</code></a></em></div><div class="item-body"><div class="parameters"><div class="label">Parameters:</div><ul><li class="param"><span class="name ui label mini horizontal">fn</span><span class="type">function</span><p class="desc">此方法支持两个传入参数,第一个参数是当前迭代的值,第二个是当前迭代的键值。
如果我们在某此回调时返回了false,那么迭代过程会就此终止,类似于在循环体中使用了break。其他任何返回值或不定义返回值,迭代过程都将继续执行。
</p></li></ul></div><div class="return"><span class="label">Returns:</span><span class="type">cola.util.KeyedArray</span></div><pre class="description"></pre></div></div></div></div></div></div></div></div></div></div><div id="sidebar" c-widget="layer" class="ui layer"><div class="v-box"><div class="box"><div class="ui menu inverted"><a id="backButton" class="item icon"><i class="angle left icon"></i></a><div class="item"><div class="ui icon input transparent inverted"><input id="sidebarSearchInput" type="text" placeholder="搜索..."></div></div><a id="searchButton" class="item icon"><i class="search icon"></i></a></div></div><div class="flex-box"><div><div class="ui list"><a href="./$.html" class="item data-item">$</a><a href="./cola.html" class="item data-item">cola</a><a href="./cola.AbstractButton.html" class="item data-item">cola.AbstractButton</a><a href="./cola.AbstractCheckbox.html" class="item data-item">cola.AbstractCheckbox</a><a href="./cola.AbstractContainer.html" class="item data-item">cola.AbstractContainer</a><a href="./cola.AbstractDropdown.html" class="item data-item">cola.AbstractDropdown</a><a href="./cola.AbstractEditor.html" class="item data-item">cola.AbstractEditor</a><a href="./cola.AbstractInput.html" class="item data-item">cola.AbstractInput</a><a href="./cola.AbstractItemGroup.html" class="item data-item">cola.AbstractItemGroup</a><a href="./cola.AbstractList.html" class="item data-item">cola.AbstractList</a><a href="./cola.AbstractMenuItem.html" class="item data-item">cola.AbstractMenuItem</a><a href="./cola.AbstractSlotList.html" class="item data-item">cola.AbstractSlotList</a><a href="./cola.AjaxValidator.html" class="item data-item">cola.AjaxValidator</a><a href="./cola.AsyncValidator.html" class="item data-item">cola.AsyncValidator</a><a href="./cola.Avatar.html" class="item data-item">cola.Avatar</a><a href="./cola.Breadcrumb.html" class="item data-item">cola.Breadcrumb</a><a href="./cola.Button.html" class="item data-item">cola.Button</a><a href="./cola.ButtonGroup.html" class="item data-item">cola.ButtonGroup</a><a href="./cola.Calendar.html" class="item data-item">cola.Calendar</a><a href="./cola.CardBook.html" class="item data-item">cola.CardBook</a><a href="./cola.Carousel.html" class="item data-item">cola.Carousel</a><a href="./cola.CascadeBind.html" class="item data-item">cola.CascadeBind</a><a href="./cola.Checkbox.html" class="item data-item">cola.Checkbox</a><a href="./cola.ControlMenuItem.html" class="item data-item">cola.ControlMenuItem</a><a href="./cola.Corner.html" class="item data-item">cola.Corner</a><a href="./cola.CustomDropdown.html" class="item data-item">cola.CustomDropdown</a><a href="./cola.CustomValidator.html" class="item data-item">cola.CustomValidator</a><a href="./cola.DataType.html" class="item data-item">cola.DataType</a><a href="./cola.DatePicker.html" class="item data-item">cola.DatePicker</a><a href="./cola.DateTimePicker.html" class="item data-item">cola.DateTimePicker</a><a href="./cola.Definition.html" class="item data-item">cola.Definition</a><a href="./cola.Dialog.html" class="item data-item">cola.Dialog</a><a href="./cola.Divider.html" class="item data-item">cola.Divider</a><a href="./cola.Dropdown.html" class="item data-item">cola.Dropdown</a><a href="./cola.DropdownMenuItem.html" class="item data-item">cola.DropdownMenuItem</a><a href="./cola.Element.html" class="item data-item">cola.Element</a><a href="./cola.EmailValidator.html" class="item data-item">cola.EmailValidator</a><a href="./cola.Entity.html" class="item data-item">cola.Entity</a><a href="./cola.EntityDataType.html" class="item data-item">cola.EntityDataType</a><a href="./cola.EntityList.html" class="item data-item">cola.EntityList</a><a href="./cola.FieldSet.html" class="item data-item">cola.FieldSet</a><a href="./cola.GroupBox.html" class="item data-item">cola.GroupBox</a><a href="./cola.HeaderMenuItem.html" class="item data-item">cola.HeaderMenuItem</a><a href="./cola.IFrame.html" class="item data-item">cola.IFrame</a><a href="./cola.Image.html" class="item data-item">cola.Image</a><a href="./cola.Input.html" class="item data-item">cola.Input</a><a href="./cola.ItemsView.html" class="item data-item">cola.ItemsView</a><a href="./cola.Label.html" class="item data-item">cola.Label</a><a href="./cola.Layer.html" class="item data-item">cola.Layer</a><a href="./cola.LengthValidator.html" class="item data-item">cola.LengthValidator</a><a href="./cola.Link.html" class="item data-item">cola.Link</a><a href="./cola.ListView.html" class="item data-item">cola.ListView</a><a href="./cola.Menu.html" class="item data-item">cola.Menu</a><a href="./cola.MenuButton.html" class="item data-item">cola.MenuButton</a><a href="./cola.MenuItem.html" class="item data-item">cola.MenuItem</a><a href="./cola.Model.html" class="item data-item">cola.Model</a><a href="./cola.MultiSlotPicker.html" class="item data-item">cola.MultiSlotPicker</a><a href="./cola.NestedList.html" class="item data-item">cola.NestedList</a><a href="./cola.NestedListBind.html" class="item data-item">cola.NestedListBind</a><a href="./cola.NestedListNode.html" class="item data-item">cola.NestedListNode</a><a href="./cola.Node.html" class="item data-item">cola.Node</a><a href="./cola.NotifyTipManager.html" class="item data-item">cola.NotifyTipManager</a><a href="./cola.NumberValidator.html" class="item data-item">cola.NumberValidator</a><a href="./cola.Pager.html" class="item data-item">cola.Pager</a><a href="./cola.Panel.html" class="item data-item">cola.Panel</a><a href="./cola.PointingLabel.html" class="item data-item">cola.PointingLabel</a><a href="./cola.Progress.html" class="item data-item">cola.Progress</a><a href="./cola.Property.html" class="item data-item">cola.Property</a><a href="./cola.Provider.html" class="item data-item">cola.Provider</a><a href="./cola.RadioButton.html" class="item data-item">cola.RadioButton</a><a href="./cola.RadioGroup.html" class="item data-item">cola.RadioGroup</a><a href="./cola.RangeSlotList.html" class="item data-item">cola.RangeSlotList</a><a href="./cola.Rating.html" class="item data-item">cola.Rating</a><a href="./cola.RegExpValidator.html" class="item data-item">cola.RegExpValidator</a><a href="./cola.RenderableElement.html" class="item data-item">cola.RenderableElement</a><a href="./cola.RequiredValidator.html" class="item data-item">cola.RequiredValidator</a><a href="./cola.Reveal.html" class="item data-item">cola.Reveal</a><a href="./cola.Ribbon.html" class="item data-item">cola.Ribbon</a><a href="./cola.Segment.html" class="item data-item">cola.Segment</a><a href="./cola.Select.html" class="item data-item">cola.Select</a><a href="./cola.Sidebar.html" class="item data-item">cola.Sidebar</a><a href="./cola.Slider.html" class="item data-item">cola.Slider</a><a href="./cola.SlotList.html" class="item data-item">cola.SlotList</a><a href="./cola.SplitPane.html" class="item data-item">cola.SplitPane</a><a href="./cola.Stack.html" class="item data-item">cola.Stack</a><a href="./cola.Steps.html" class="item data-item">cola.Steps</a><a href="./cola.SubView.html" class="item data-item">cola.SubView</a><a href="./cola.Tab.html" class="item data-item">cola.Tab</a><a href="./cola.TabButton.html" class="item data-item">cola.TabButton</a><a href="./cola.Table.html" class="item data-item">cola.Table</a><a href="./cola.TableColumn.html" class="item data-item">cola.TableColumn</a><a href="./cola.TableContentColumn.html" class="item data-item">cola.TableContentColumn</a><a href="./cola.TableDataColumn.html" class="item data-item">cola.TableDataColumn</a><a href="./cola.TableGroupColumn.html" class="item data-item">cola.TableGroupColumn</a><a href="./cola.TableSelectColumn.html" class="item data-item">cola.TableSelectColumn</a><a href="./cola.Tag.html" class="item data-item">cola.Tag</a><a href="./cola.TimeLine.html" class="item data-item">cola.TimeLine</a><a href="./cola.TitleBar.html" class="item data-item">cola.TitleBar</a><a href="./cola.Toggle.html" class="item data-item">cola.Toggle</a><a href="./cola.Tree.html" class="item data-item">cola.Tree</a><a href="./cola.TreeNode.html" class="item data-item">cola.TreeNode</a><a href="./cola.TreeNodeBind.html" class="item data-item">cola.TreeNodeBind</a><a href="./cola.UrlValidator.html" class="item data-item">cola.UrlValidator</a><a href="./cola.Validator.html" class="item data-item">cola.Validator</a><a href="./cola.Widget.html" class="item data-item">cola.Widget</a><a href="./cola.breadcrumb.Section.html" class="item data-item">cola.breadcrumb.Section</a><a href="./cola.browser.html" class="item data-item">cola.browser</a><a href="./cola.buttonGroup.Separator.html" class="item data-item">cola.buttonGroup.Separator</a><a href="./cola.contants.html" class="item data-item">cola.contants</a><a href="./cola.defaultAction.html" class="item data-item">cola.defaultAction</a><a href="./cola.device.html" class="item data-item">cola.device</a><a href="./cola.os.html" class="item data-item">cola.os</a><a href="./cola.steps.Step.html" class="item data-item">cola.steps.Step</a><a href="./cola.tab.AbstractTabButton.html" class="item data-item">cola.tab.AbstractTabButton</a><a href="./cola.util.html" class="item data-item">cola.util</a><a href="./cola.util.KeyedArray.html" class="item data-item active">cola.util.KeyedArray</a></div></div></div></div></div></body><script src="./resources/javascript.js"></script><script src="./resources/doc.js"></script></html>