private int calculateRealLength(final int position,final int length){
  return length != -1 ? length : m_text.length() - position;
}

private int calculateRealLength ( final int position , final int length ) { return length != - 1 ? length : m_text . length ( ) - position ; }
the functions that modify part of the line take a parameter length that describes how many characters are changed . this parameter can be - 1 to mean " until the end of the line " . this function takes the given length and converts it into the real number of characters to be modified .
