org.mbari.ma2
Class Ma2Util

java.lang.Object
  extended byorg.mbari.ma2.Ma2Util

public class Ma2Util
extends java.lang.Object

Title: mbariMoos web application project Description: The goal of this project is to develop server side processes for use in disseminating OASIS and MOOS data sets. Copyright: Copyright (c) 2001 Company: MBARI Functions (i.e static methods) for operating on Multiarray (version 2) (ucar.ma2.*)

Version:
31 Jul 2001
Author:
Brian Schlining

Method Summary
static int binarySearch(ucar.ma2.Array ma, long key, int keyDimension)
          Search a multiarray using a binary search
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

binarySearch

public static int binarySearch(ucar.ma2.Array ma,
                               long key,
                               int keyDimension)
Search a multiarray using a binary search

Parameters:
ma - The interface ucar.ma2.Array to search
key - The value to search for
keyDimension - Specifies the index of the dimension to search for example if its a 2-D array and the first dimension contains the keyD the keyDimension = 0
Returns:
index of the search key, if it is contained in the list; otherwise, (-(insertion point) - 1). The insertion point is defined as the point at which the key would be inserted into the list: the index of the first element greater than the key, or list.size(), if all elements in the list are less than the specified key. Note that this guarantees that the return value will be >= 0 if and only if the key is found.