code: protected int findInSortedSuballocatedIntVector(SuballocatedIntVector vector, int lookfor)
    {
      // Binary search
      int i = 0;
      if(vector != null) {
        int first = 0;
        int last  = vector.size() - 1;
  
        while (first <= last) {
          i = (first + last) / 2;
          int test = lookfor-vector.elementAt(i);
          if(test == 0) {
            return i; // Name found
          }
          else if (test < 0) {
            last = i - 1; // looked too late
          }
          else {
            first = i + 1; // looked ot early
          }
        }
  
        if (first > i) {
          i = first; // Clean up at loop end
        }
      }
  
      return -1 - i; // not-found has to be encoded.
    }
docs: Subroutine: Locate the specified node within
  m_namespaceDeclSetElements, or the last element which
  preceeds it in document order
  
  %REVIEW% Inlne this into findNamespaceContext? Create SortedSuballocatedIntVector type?
  
  @return If positive or zero, the index of the found item.
  If negative, index of the point at which it would have appeared,
  encoded as -1-index and hence reconvertable by subtracting
  it from -1. (Encoding because I don't want to recompare the strings
  but don't want to burn bytes on a datatype to hold a flagged value.)