private void addInWffIdMap ( final AbstractHtml tag ) { final Deque < Set < AbstractHtml > > childrenStack = new ArrayDeque <> ( ) ; // passed 2 instead of 1 because the load factor is 0.75f final Set < AbstractHtml > initialSet = new HashSet <> ( 2 ) ; initialSet . add ( tag ) ; childrenStack . push ( initialSet ) ; Set < AbstractHtml > children ; while ( ( children = childrenStack . poll ( ) ) != null ) { for ( final AbstractHtml child : children ) { final DataWffId wffIdAttr = child . getDataWffId ( ) ; if ( wffIdAttr != null ) { tagByWffId . put ( wffIdAttr . getValue ( ) , child ) ; } final Set < AbstractHtml > subChildren = child . getChildren ( accessObject ) ; if ( subChildren != null && subChildren . size ( ) > 0 ) { childrenStack . push ( subChildren ) ; } } } }
adds to wffid map