02.05.2014 Views

CoreandServices.book - Ocean - Schlumberger

CoreandServices.book - Ocean - Schlumberger

CoreandServices.book - Ocean - Schlumberger

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

The IndexRange2, IndexRange3, and IndexRange4 all provide the same<br />

constructors, properties, and methods. They vary only in the dimensions available. The<br />

following sections detail the constructors, properties, and methods available.<br />

Each index range type has multiple constructors. Here are some examples using<br />

IndexRange3. This is construction from existing Index3 objects:<br />

Index3 idx1 = new Index3(3, 5, 7);<br />

Index3 idx2 = new Index3(15, 17, 19);<br />

IndexRange3 ir = new IndexRange3(idx1, idx2)<br />

Here is construction from three IndexRange1 objects:<br />

Basics<br />

IndexRange1 ir1 = new IndexRange1(3, 13);<br />

IndexRange1 ir2 = new IndexRange1(5, 15);<br />

IndexRange1 ir3 = new IndexRange1(7, 17);<br />

IndexRange3 ir = new IndexRange3(ir1, ir2, ir3);<br />

Index range objects are based on begin and end positions. The positions in the beginning<br />

Index value must be less than or equal to the positions in the ending Index value. This<br />

means, for example, that attempting to create an IndexRange3 from the Index3<br />

objects (10, 20, 30) for the begin position and (5, 25, 35) for the end position will throw<br />

an argument exception since “5” in the end position is less than “10” in the start position.<br />

The index range types have a set of properties that you can use to get values for the<br />

range. The following code sample illustrates the use of the properties.<br />

Index3 start_index = new Index3 (3, 5, 7);<br />

Index3 end_index = new Index3 (13, 25, 37);<br />

IndexRange3 ir = new IndexRange3 (start_index, end_index);<br />

Begin – This property returns the starting Index position in the IndexRange.<br />

Index3 begin = ir.Begin;<br />

// begin value is (3, 5, 7)<br />

End – This property returns the ending Index position in the IndexRange.<br />

Index3 end = ir.End;<br />

// end value is (13, 25, 37)<br />

<strong>Schlumberger</strong> Private<br />

<strong>Ocean</strong> Services 4-109

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!