This repository has been archived by the owner on Jan 18, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Array.html
74 lines (74 loc) · 13.8 KB
/
Array.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<!DOCTYPE html>
<html lang="en"><!-- use theme color or fallback -->
<!--use textcolor from settings, otherwise create a contrasting color to theme color-->
<head><meta charset="utf-8"/><link href="./bootstrap/css/bootstrap.min.css" rel="stylesheet"/><link href="./bootstrap/css/bootstrap-responsive.min.css" rel="stylesheet"/><link href="./bootstrap/css/bootstrap-select.min.css" rel="stylesheet"/><link href="https://fonts.googleapis.com/css?family=Open+Sans:400,700,700italic,400italic" rel="stylesheet" type="text/css"/><link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:200,600,600italic,400" rel="stylesheet" type="text/css"/><link href="https://netdna.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.css" rel="stylesheet" type="text/css"/><script src="./jquery-1.9.1.min.js"></script><script src="./bootstrap/js/bootstrap.min.js"></script><script src="./bootstrap/js/bootstrap-select.min.js"></script><link href="./styles.css" rel="stylesheet"/><link href="./extra-styles.css" rel="stylesheet"/><link href="./haxe-nav.css" rel="stylesheet"/><script>var dox = {rootPath: "./",platforms: ["api"]};</script><script src="./nav.js"></script><script src="./index.js"></script><link rel="icon" href="./favicon.ico" type="image/x-icon"/><title>Array</title><meta name="description" content="An Array is a storage for values. You can access it using indexes or
with its API."/></head><body><style>
.navbar .brand {
display: inline-block;
float: none;
text-shadow: 0 0 0 transparent;
</style><nav class="nav"><div class="navbar"><div class="navbar-inner" style="background:#FAFAFA; border-bottom:1px solid rgba(0,0,0,.09)"><div class="container"><a class="brand" style="color:#000000" href="./">API Documentation</a></div></div></div></nav><div class="container main-content"><div class="row-fluid"><div class="span3"><div class="well sidebar-nav"><form class="form-search" id="searchForm"><div class="input-prepend input-block-level"><span class="add-on"><i class="icon-search"></i></span><input id="search" type="text" placeholder="Filter" autocomplete="off"/></div></form></div><div class="well sidebar-nav"><div id="nav"></div></div></div><div class="span9"><div class="page-header"><h1><small>class</small> Array<<span class="type">T</span>></h1><h4><small><a href="./">no package</a></small></h4> <h4><small><span class="muted">extended by </span><a class="type" title="" href="./js/lib/RegExpMatch.html">RegExpMatch</a></small></h4><span class="label label-meta label-meta-keep" title="@:keep metadata">@:keep</span><span class="label label-meta label-meta-directlyUsed" title="@:directlyUsed metadata">@:directlyUsed</span><span class="label label-meta label-meta-coreApi" title="@:coreApi metadata">@:coreApi</span><hr/></div><div class="body"><div class="doc doc-main"><div class="indent"><p>An Array is a storage for values. You can access it using indexes or
with its API.</p><p class="javadoc">See:</p><div class="indent inline-content"><p><a href="https://haxe.org/manual/std-Array.html">https://haxe.org/manual/std-Array.html</a></p></div><div class="indent inline-content"><p><a href="https://haxe.org/manual/lf-array-comprehension.html">https://haxe.org/manual/lf-array-comprehension.html</a></p></div></div></div><h3 class="section">Constructor</h3><div class="fields"><div class="field "><a name="new"></a><h3 class="anchor"><code><a href="#new"><span class="identifier">new</span></a> ()</code></h3><div class="doc"><p>Creates a new Array.</p></div></div></div><h3 class="section">Variables</h3><div class="fields"><div class="field "><a name="length"></a><h3 class="anchor"><code><span class="label">read only</span><a href="./Array.html#length"><span class="identifier">length</span></a>:<a class="type" title="The standard Int type." href="./Int.html">Int</a></code></h3><div class="doc"><p>The length of <code>this</code> Array.</p></div></div></div><h3 class="section">Methods</h3><div class="fields"><div class="field "><a name="concat"></a><h3 class="anchor"><code><a href="#concat"><span class="identifier">concat</span></a> (<span style="white-space:nowrap">a:<a class="type" title="An Array is a storage for values." href="./Array.html">Array</a><<span class="type">T</span>></span>):<a class="type" title="An Array is a storage for values." href="./Array.html">Array</a><<span class="type">T</span>></code></h3><div class="doc"><p>Returns a new Array by appending the elements of <code>a</code> to the elements of
<code>this</code> Array.</p>
<p>This operation does not modify <code>this</code> Array.</p>
<p>If <code>a</code> is the empty Array <code>[]</code>, a copy of <code>this</code> Array is returned.</p>
<p>The length of the returned Array is equal to the sum of <code>this.<a href="#length">length</a></code>
and <code>a.length</code>.</p>
<p>If <code>a</code> is <code>null</code>, the result is unspecified.</p></div></div><div class="field "><a name="indexOf"></a><h3 class="anchor"><code><a href="#indexOf"><span class="identifier">indexOf</span></a> (<span style="white-space:nowrap">x:<span class="type">T</span>,</span> <span style="white-space:nowrap">?fromIndex:<a class="type" title="The standard Int type." href="./Int.html">Int</a></span>):<a class="type" title="The standard Int type." href="./Int.html">Int</a></code></h3><div class="doc"><p>Returns position of the first occurrence of <code>x</code> in <code>this</code> Array, searching front to back.</p>
<p>If <code>x</code> is found by checking standard equality, the function returns its index.</p>
<p>If <code>x</code> is not found, the function returns -1.</p>
<p>If <code>fromIndex</code> is specified, it will be used as the starting index to search from,
otherwise search starts with zero index. If it is negative, it will be taken as the
offset from the end of <code>this</code> Array to compute the starting index. If given or computed
starting index is less than 0, the whole array will be searched, if it is greater than
or equal to the length of <code>this</code> Array, the function returns -1.</p></div></div><div class="field "><a name="iterator"></a><h3 class="anchor"><code><span class="label label-meta label-meta-runtime" title="@:runtime metadata">@:runtime</span><span class="label label-inline">inline</span><a href="#iterator"><span class="identifier">iterator</span></a> ():<a class="type" title="An Iterator is a structure that permits iteration over elements of type T." href="./Iterator.html">Iterator</a><<span class="type">T</span>></code></h3><div class="doc"><p>Returns an iterator of the Array values.</p></div></div><div class="field "><a name="join"></a><h3 class="anchor"><code><a href="#join"><span class="identifier">join</span></a> (<span style="white-space:nowrap">sep:<a class="type" title="The basic String class." href="./String.html">String</a></span>):<a class="type" title="The basic String class." href="./String.html">String</a></code></h3><div class="doc"><p>Returns a string representation of <code>this</code> Array, with <code>sep</code> separating
each element.</p>
<p>The result of this operation is equal to <code><a href="./Std.html#string">Std.string</a>(this[0]) + sep +
<a href="./Std.html#string">Std.string</a>(this[1]) + sep + ... + sep + <a href="./Std.html#string">Std.string</a>(this[this.<a href="#length">length</a>-1])</code></p>
<p>If <code>this</code> is the empty Array <code>[]</code>, the result is the empty String <code>""</code>.
If <code>this</code> has exactly one element, the result is equal to a call to
<code><a href="./Std.html#string">Std.string</a>(this[0])</code>.</p>
<p>If <code>sep</code> is null, the result is unspecified.</p></div></div><div class="field "><a name="pop"></a><h3 class="anchor"><code><a href="#pop"><span class="identifier">pop</span></a> ():<a class="type" title="Null&lt;T&gt; is a wrapper that can be used to make the basic types Int, Float and Bool nullable on static targets." href="./Null.html">Null</a><<span class="type">T</span>></code></h3><div class="doc"><p>Removes the last element of <code>this</code> Array and returns it.</p>
<p>This operation modifies <code>this</code> Array in place.</p>
<p>If <code>this</code> has at least one element, <code>this.<a href="#length">length</a></code> will decrease by 1.</p>
<p>If <code>this</code> is the empty Array <code>[]</code>, null is returned and the length
remains 0.</p></div></div><div class="field "><a name="push"></a><h3 class="anchor"><code><a href="#push"><span class="identifier">push</span></a> (<span style="white-space:nowrap">x:<span class="type">T</span></span>):<a class="type" title="The standard Int type." href="./Int.html">Int</a></code></h3><div class="doc"><p>Adds the element <code>x</code> at the end of <code>this</code> Array and returns the new
length of <code>this</code> Array.</p>
<p>This operation modifies <code>this</code> Array in place.</p>
<p><code>this.<a href="#length">length</a></code> increases by 1.</p></div></div><div class="field "><a name="shift"></a><h3 class="anchor"><code><a href="#shift"><span class="identifier">shift</span></a> ():<a class="type" title="Null&lt;T&gt; is a wrapper that can be used to make the basic types Int, Float and Bool nullable on static targets." href="./Null.html">Null</a><<span class="type">T</span>></code></h3><div class="doc"><p>Removes the first element of <code>this</code> Array and returns it.</p>
<p>This operation modifies <code>this</code> Array in place.</p>
<p>If <code>this</code> has at least one element, <code>this</code>.length and the index of each
remaining element is decreased by 1.</p>
<p>If <code>this</code> is the empty Array <code>[]</code>, <code>null</code> is returned and the length
remains 0.</p></div></div><div class="field "><a name="slice"></a><h3 class="anchor"><code><a href="#slice"><span class="identifier">slice</span></a> (<span style="white-space:nowrap">pos:<a class="type" title="The standard Int type." href="./Int.html">Int</a>,</span> <span style="white-space:nowrap">?end:<a class="type" title="The standard Int type." href="./Int.html">Int</a></span>):<a class="type" title="An Array is a storage for values." href="./Array.html">Array</a><<span class="type">T</span>></code></h3><div class="doc"><p>Creates a shallow copy of the range of <code>this</code> Array, starting at and
including <code>pos</code>, up to but not including <code>end</code>.</p>
<p>This operation does not modify <code>this</code> Array.</p>
<p>The elements are not copied and retain their identity.</p>
<p>If <code>end</code> is omitted or exceeds <code>this.<a href="#length">length</a></code>, it defaults to the end of
<code>this</code> Array.</p>
<p>If <code>pos</code> or <code>end</code> are negative, their offsets are calculated from the
end of <code>this</code> Array by <code>this.<a href="#length">length</a> + pos</code> and <code>this.<a href="#length">length</a> + end</code>
respectively. If this yields a negative value, 0 is used instead.</p>
<p>If <code>pos</code> exceeds <code>this.<a href="#length">length</a></code> or if <code>end</code> is less than or equals
<code>pos</code>, the result is <code>[]</code>.</p></div></div><div class="field "><a name="sort"></a><h3 class="anchor"><code><a href="#sort"><span class="identifier">sort</span></a> (<span style="white-space:nowrap">f:<span class="type">T</span> ‑> <span class="type">T</span> ‑> <a class="type" title="The standard Int type." href="./Int.html">Int</a></span>):<a class="type" title="The standard Void type." href="./Void.html">Void</a></code></h3><div class="doc"><p>Sorts <code>this</code> Array according to the comparison function <code>f</code>, where
<code>f(x,y)</code> returns 0 if x == y, a positive Int if x > y and a
negative Int if x < y.</p>
<p>This operation modifies <code>this</code> Array in place.</p>
<p>The sort operation is not guaranteed to be stable, which means that the
order of equal elements may not be retained. For a stable Array sorting
algorithm, <code>haxe.ds.ArraySort.sort()</code> can be used instead.</p>
<p>If <code>f</code> is null, the result is unspecified.</p></div></div><div class="field "><a name="splice"></a><h3 class="anchor"><code><a href="#splice"><span class="identifier">splice</span></a> (<span style="white-space:nowrap">pos:<a class="type" title="The standard Int type." href="./Int.html">Int</a>,</span> <span style="white-space:nowrap">len:<a class="type" title="The standard Int type." href="./Int.html">Int</a></span>):<a class="type" title="An Array is a storage for values." href="./Array.html">Array</a><<span class="type">T</span>></code></h3><div class="doc"><p>Removes <code>len</code> elements from <code>this</code> Array, starting at and including
<code>pos</code>, an returns them.</p>
<p>This operation modifies <code>this</code> Array in place.</p>
<p>If <code>len</code> is < 0 or <code>pos</code> exceeds <code>this</code>.length, an empty Array [] is
returned and <code>this</code> Array is unchanged.</p>
<p>If <code>pos</code> is negative, its value is calculated from the end of <code>this</code>
Array by <code>this.<a href="#length">length</a> + pos</code>. If this yields a negative value, 0 is
used instead.</p>
<p>If the sum of the resulting values for <code>len</code> and <code>pos</code> exceed
<code>this.<a href="#length">length</a></code>, this operation will affect the elements from <code>pos</code> to the
end of <code>this</code> Array.</p>
<p>The length of the returned Array is equal to the new length of <code>this</code>
Array subtracted from the original length of <code>this</code> Array. In other
words, each element of the original <code>this</code> Array either remains in
<code>this</code> Array or becomes an element of the returned Array.</p></div></div></div></div></div></div></div><footer class="section site-footer" style="background:#FAFAFA"><div class="container"><div class="copyright"><p style="color:#000000">© 2019 </p></div></div></footer><script src=".//highlighter.js"></script><link href="./highlighter.css" rel="stylesheet"/></body></html>