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.

Basics<br />

Origin – This property returns the Origin value.<br />

Index2 origVal = extVal.Origin;<br />

//result is an Index2 of 1, 2<br />

Stride – This property returns the increment for each Extent in the Extent2. This is<br />

the constant step between the values.<br />

Index2 incVal = extVal.Stride;<br />

//result is an Index2 of 1, 1<br />

The methods exposed by this class are as follows:<br />

Extent2 extVal = new Extent2(new Index2 (1, 2), new Index2(5, 10));<br />

Clone – This method is an overridden base class method and creates a cloned copy of the<br />

object.<br />

Extent2 clonedVal = (Extent2)extVal.Clone();<br />

Contains - This method checks whether given position is represented by this Extent2.<br />

To be represented, each of the values in the input Index2 must be within its respective<br />

Extent in the Extent2. In the first example, the first Extent in the Extent2 contains<br />

the 1, but the second does not contain the 20 so the result is false. In the second<br />

example, both values (1 & 3) are contained in their respective Extent objects.<br />

bool result = extVal.Contains(new Index2 (1, 20));<br />

//result is false. Second extent doesn’t contain 20<br />

result = extVal.Contains(new Index2 (1, 3));<br />

//result is true. Values are in respective Extentss<br />

ContainsIndex - This method checks whether the given index is valid for this<br />

Extent2. This means that the values provided in the input Index2 are valid indexes into<br />

the array represented by the Extent contained in the Extent2. The first case below is<br />

true because both indexes are valid. The second case is false because 12 is an index<br />

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