code: public int previous() {
          int index;  // offset in ICU4C
          if (search_.reset_) {
              index = search_.endIndex();   // m_search_->textLength in ICU4C
              search_.isForwardSearching_ = false;
              search_.reset_ = false;
              setIndex(index);
          } else {
              index = getIndex();
          }
  
          int matchindex = search_.matchedIndex_;
          if (search_.isForwardSearching_) {
              // switching direction. 
              // if matchedIndex == DONE, it means that either a 
              // setIndex (setOffset in C) has been called or that next ran off the text
              // string. the iterator would have been set to offset textLength if 
              // a match is not found.
              search_.isForwardSearching_ = false;
              if (matchindex != DONE) {
                  return matchindex;
              }
          } else {
              int startIdx = search_.beginIndex();
              if (index == startIdx || matchindex == startIdx) {
                  // not enough characters to match
                  setMatchNotFound();
                  return DONE; 
              }
          }
  
          if (matchindex != DONE) {
              if (search_.isOverlap_) {
                  matchindex += search_.matchedLength() - 2;
              }
  
              return handlePrevious(matchindex);
          }
  
          return handlePrevious(index);
      }
docs: Returns the index of the previous point at which the string text
  matches the search pattern, starting at the current position.
  The iterator is adjusted so that its current index (as returned by
  {@link #getIndex}) is the match position if one was found.
  If a match is not found, {@link #DONE} will be returned and
  the iterator will be adjusted to the index {@link #DONE}.
  
  @return The index of the previous match before the current position,
  or {@link #DONE} if there are no more matches.
  @see #getIndex