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 Extent class is a sealed class that provides several constructors. This one creates an<br />

empty Extent.<br />

Extent e = new Extent( );<br />

Here we make a copy of the created Extent.<br />

Extent myExt = Extent( e );<br />

This one will create an Extent with a starting value of 10 and a size of 20. The size must<br />

be greater than or equal to 0.<br />

int begin = 10;<br />

int size = 20;<br />

Extent myExt = new Extent( begin, size );<br />

// results is 10, 11, 12, ..., 28, 29<br />

Create an Extent with a given starting value and of a given size but with an increment<br />

other than 1. The size must be greater than or equal to 0, and the increment, or stride,<br />

must not be 0.<br />

int begin = 10;<br />

int size = 20;<br />

int stride = -3;<br />

Extent myExt = new Extent( begin, size, stride );<br />

// result is 10, 7, 4, 1, -2, -5, ..., -44, -47<br />

The Extent class has properties that you can use to access it.<br />

Extent extVal = new Extent(2, 10);<br />

// result is [2, 3, 4, 5, 6, 7, 8, 9, 10, 11]<br />

Back - This property returns value at last index.<br />

int backVal = extVal.Back;<br />

//result is 11<br />

Front - This property returns value at the first index.<br />

int frontVal = extVal.Front;<br />

//result is 2<br />

4-112 <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!