private int translateElementNo ( int i ) { if ( ! useList || i < 0 ) { return i ; } int j = 0 ; PatternRule rule = ( PatternRule ) this . rule ; for ( int k = 0 ; k < i ; k ++ ) { j += rule . getElementNo ( ) . get ( k ) ; } return j ; }
Gets the index of the element indexed by i adding any offsets because of the phrases in the rule .