polymorphism: better names for .binaryValue and .booleanValue are .asInteger and...
[supercollider.git] / Help / Collections / Interval.html
blobb1e45f91f34b406b4b31d842b734c44e7b6824b1
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
2 <html>
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5 <meta http-equiv="Content-Style-Type" content="text/css">
6 <title></title>
7 <meta name="Generator" content="Cocoa HTML Writer">
8 <meta name="CocoaVersion" content="949.43">
9 <style type="text/css">
10 p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica}
11 p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px}
12 p.p3 {margin: 0.0px 0.0px 0.0px 0.0px; font: 14.0px Helvetica}
13 p.p4 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco}
14 p.p5 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco; color: #ad140d}
15 p.p6 {margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco}
16 span.s1 {font: 18.0px Helvetica}
17 span.s2 {color: #001bb9}
18 span.s3 {color: #000000}
19 span.Apple-tab-span {white-space:pre}
20 </style>
21 </head>
22 <body>
23 <p class="p1"><span class="s1"><b>Interval<span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></b></span><b>range of integers<span class="Apple-converted-space"> </span></b></p>
24 <p class="p2"><br></p>
25 <p class="p1"><b>superclass: Collection</b></p>
26 <p class="p2"><br></p>
27 <p class="p1">An Interval is a range of integers from a starting value to an ending value by some step value.</p>
28 <p class="p2"><br></p>
29 <p class="p3"><b>Creation</b></p>
30 <p class="p2"><br></p>
31 <p class="p1"><b>*new(start, end, step)</b></p>
32 <p class="p2"><br></p>
33 <p class="p1">Create a new Interval.</p>
34 <p class="p2"><br></p>
35 <p class="p4"><span class="s2">Interval</span>(10, 30, 4);</p>
36 <p class="p5"><span class="s3">10 to: 30; </span>// the message to creates an interval with step 1</p>
37 <p class="p2"><br></p>
38 <p class="p3"><b>Instance Variables</b></p>
39 <p class="p2"><br></p>
40 <p class="p1"><b>&lt;&gt;start<span class="Apple-converted-space"> </span></b></p>
41 <p class="p2"><br></p>
42 <p class="p1">The starting value of the interval.</p>
43 <p class="p2"><br></p>
44 <p class="p1"><b>&lt;&gt;end<span class="Apple-converted-space"> </span></b></p>
45 <p class="p2"><br></p>
46 <p class="p1">The ending value of the interval.</p>
47 <p class="p2"><br></p>
48 <p class="p1"><b>&lt;&gt;step<span class="Apple-converted-space"> </span></b></p>
49 <p class="p2"><br></p>
50 <p class="p1">The step value of the interval.</p>
51 <p class="p2"><br></p>
52 <p class="p2"><br></p>
53 <p class="p3"><b>Instance Methods</b></p>
54 <p class="p2"><br></p>
55 <p class="p1"><b>size</b></p>
56 <p class="p2"><br></p>
57 <p class="p1">Return the number of items in the interval.</p>
58 <p class="p2"><br></p>
59 <p class="p6"><span class="s2">Interval</span>(10, 30, 4).size.postln;</p>
60 <p class="p2"><br></p>
61 <p class="p2"><br></p>
62 <p class="p1"><b>at(index)</b></p>
63 <p class="p2"><br></p>
64 <p class="p1">Return the indexed item in the interval.</p>
65 <p class="p2"><br></p>
66 <p class="p4"><span class="s2">Interval</span>(10, 30, 4).at(3).postln;</p>
67 <p class="p2"><br></p>
68 <p class="p2"><br></p>
69 <p class="p1"><b>do(function)</b></p>
70 <p class="p2"><br></p>
71 <p class="p1">Evaluates function for each item in the interval.</p>
72 <p class="p1">The function is passed two arguments, the item and an integer index.</p>
73 <p class="p2"><br></p>
74 <p class="p4"><span class="s2">Interval</span>(10, 30, 4).do({ <span class="s2">arg</span> item, i; item.postln });</p>
75 <p class="p2"><br></p>
76 <p class="p2"><br></p>
77 </body>
78 </html>