public void put ( ElementType x ) { if ( full ( ) ) { getIdx = ( getIdx + 1 ) % elements . length ; } else { size ++ ; } elements [ putIdx ] = x ; putIdx = ( putIdx + 1 ) % elements . length ; }
Inserts an element and overwrites old one when full .