protected boolean arePathsContiguous(TreePath[] paths){
  if (rowMapper == null || paths.length < 2)   return true;
 else {
    BitSet bitSet=new BitSet(32);
    int anIndex, counter, min;
    int pathCount=paths.length;
    int validCount=0;
    TreePath[] tempPath=new TreePath[1];
    tempPath[0]=paths[0];
    min=rowMapper.getRowsForPaths(tempPath)[0];
    for (counter=0; counter < pathCount; counter++) {
      if (paths[counter] != null) {
        tempPath[0]=paths[counter];
        int[] rows=rowMapper.getRowsForPaths(tempPath);
        if (rows == null) {
          return false;
        }
        anIndex=rows[0];
        if (anIndex == -1 || anIndex < (min - pathCount) || anIndex > (min + pathCount))         return false;
        if (anIndex < min)         min=anIndex;
        if (!bitSet.get(anIndex)) {
          bitSet.set(anIndex);
          validCount++;
        }
      }
    }
    int maxCounter=validCount + min;
    for (counter=min; counter < maxCounter; counter++)     if (!bitSet.get(counter))     return false;
  }
  return true;
}

protected boolean arePathsContiguous ( TreePath [ ] paths ) { if ( rowMapper == null || paths . length < 2 ) return true ; else { BitSet bitSet = new BitSet ( 32 ) ; int anIndex , counter , min ; int pathCount = paths . length ; int validCount = 0 ; TreePath [ ] tempPath = new TreePath [ 1 ] ; tempPath [ 0 ] = paths [ 0 ] ; min = rowMapper . getRowsForPaths ( tempPath ) [ 0 ] ; for ( counter = 0 ; counter < pathCount ; counter ++ ) { if ( paths [ counter ] != null ) { tempPath [ 0 ] = paths [ counter ] ; int [ ] rows = rowMapper . getRowsForPaths ( tempPath ) ; if ( rows == null ) { return false ; } anIndex = rows [ 0 ] ; if ( anIndex == - 1 || anIndex < ( min - pathCount ) || anIndex > ( min + pathCount ) ) return false ; if ( anIndex < min ) min = anIndex ; if ( ! bitSet . get ( anIndex ) ) { bitSet . set ( anIndex ) ; validCount ++ ; } } } int maxCounter = validCount + min ; for ( counter = min ; counter < maxCounter ; counter ++ ) if ( ! bitSet . get ( counter ) ) return false ; } return true ; }
returns true if the paths are contiguous , or this object has no rowmapper .
