02.05.2014 Views

CoreandServices.book - Ocean - Schlumberger

CoreandServices.book - Ocean - Schlumberger

CoreandServices.book - Ocean - Schlumberger

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Basics<br />

The following examples use Extent2. Here we construct an empty Extent2.<br />

Extent2 ext = new Extent2( );<br />

This is construction from two Extent objects. The result is an Extent2 that contains two<br />

separate Extent objects. In the case of an Extent3, the input would be three separate<br />

Extent objects and the result would be an Exent3.<br />

Extent x = new Extent (5, 10);<br />

Extent y = new Extent (25, 15);<br />

Extent2 ext2 = new Extent2 (x, y);<br />

Here we construct a copy of an Extent2.<br />

Extent2 copyExt2 = new Extent2 (ext2);<br />

This is construction from an Extent[ ] array. The quantity of Extent objects in the<br />

input array that ends up in the created Extent2 or Extent3 is either two or three<br />

respectively. For example, using an array of three Extent objects to create an Extent2<br />

will create an Extent2 that only contains the first two members of the array.<br />

public Extent2 (Extent[ ] rhs);<br />

This one constructs from two Index2 objects. The first Index2 object values define the<br />

beginning values for each Extent in the Extent2. The second Index2 object values<br />

define the size of each Extent in the Extent2 object. Using the Index2 of (5, 10) for<br />

the beginning value and (20, 50) for the sizes, we end up with an Extent2 that contains<br />

two Extent objects whose values range from 5 to 24 and 10 to 59 respectively.<br />

// Starts for Extents of 5 and 10<br />

Index2 begin = new Index2 (5, 10);<br />

// Size of each extent as 20 for first, 50 for second<br />

Index2 size = new Index2(20, 50);<br />

Extent2 ext2 = new Extent2(begin, size);<br />

// Result [5 : 1 : 24, 10 : 1 : 59]<br />

Here we construct from three Index2 objects. The first are the beginning values. The<br />

second are the size values. The third Index2 are the increments between values. Using<br />

4-118 <strong>Ocean</strong> Application Development Framework 2008.1<br />

<strong>Schlumberger</strong> Private

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

Saved successfully!

Ooh no, something went wrong!