public Record getCurrentLevelInfo ( int iOffsetFromCurrentLevel , Record record ) { int dLevel = ( int ) this . getScreenRecord ( ) . getField ( ProjectTaskScreenRecord . CURRENT_LEVEL ) . getValue ( ) ; dLevel = dLevel + iOffsetFromCurrentLevel ; this . getScreenRecord ( ) . getField ( ProjectTaskScreenRecord . CURRENT_LEVEL ) . setValue ( dLevel ) ; if ( m_rgCurrentLevelInfo . size ( ) >= dLevel ) { try { m_rgCurrentLevelInfo . add ( ( Record ) record . clone ( ) ) ; m_rgCurrentLevelInfo . elementAt ( dLevel ) . setKeyArea ( ProjectTask . PARENT_PROJECT_TASK_ID_KEY ) ; } catch ( CloneNotSupportedException ex ) { ex . printStackTrace ( ) ; } } return m_rgCurrentLevelInfo . elementAt ( dLevel ) ; }
Add to the current level then get the record at this level If the record doesn t exist clone a new one and return it .