public List < Duplet < String , ArrayList < WComponent > > > getTerms ( ) { Map < String , Duplet < String , ArrayList < WComponent > > > componentsByTerm = new HashMap <> ( ) ; List < Duplet < String , ArrayList < WComponent > > > result = new ArrayList <> ( ) ; List < WComponent > childList = content . getComponentModel ( ) . getChildren ( ) ; if ( childList != null ) { for ( int i = 0 ; i < childList . size ( ) ; i ++ ) { WComponent child = childList . get ( i ) ; String term = child . getTag ( ) ; Duplet < String , ArrayList < WComponent > > termComponents = componentsByTerm . get ( term ) ; if ( termComponents == null ) { termComponents = new Duplet <> ( term , new ArrayList < WComponent > ( ) ) ; componentsByTerm . put ( term , termComponents ) ; result . add ( termComponents ) ; } termComponents . getSecond ( ) . add ( child ) ; } } return result ; }
Groups a definition list s child components by their term for rendering .