int getEndingGroupLevel( ) throws DataException
public int getEndingGroupLevel( ) throws DataException
	int getEndingGroupLevel( ) throws DataException	{		checkHasCurrentRow( );		// Always return 0 for last row (which ends group 0 - the entire list)		if ( cacheProvider.getCurrentIndex( ) == cacheProvider.getCount( ) - 1 )			return 0;		// 1 is returned if no groups are defined		if ( groups.length == 0 )			return 1;		// Find outermost group that current row ends		int childGroupIdx = cacheProvider.getCurrentIndex( );		int currentGroupIdx = leafGroupIdx;		int level;		for ( level = groups.length - 1; level >= 0; level-- )		{			// Current row is known to end child group with index childGroupIdx			// Does it also end this group?			GroupInfo nextGroup = findGroup( level, currentGroupIdx + 1 );			if ( nextGroup != null && childGroupIdx == nextGroup.firstChild - 1 )			{				// Yes it also ends this group; check if it ends parent as well				childGroupIdx = currentGroupIdx;				currentGroupIdx = findGroup( level, currentGroupIdx ).parent;				continue;			}			break;		}		// current row ends group (level +1 ). Note that the group index we		// return is 1-based		return level + 2;	}