private static Map < String , ModelDescription > assigneModelsToViews ( Map < ModelDescription , XLinkConnectorView [ ] > modelsToViews ) { HashMap < String , ModelDescription > viewsToModels = new HashMap < String , ModelDescription > ( ) ; for ( ModelDescription modelInfo : modelsToViews . keySet ( ) ) { List < XLinkConnectorView > currentViewList = Arrays . asList ( modelsToViews . get ( modelInfo ) ) ; for ( XLinkConnectorView view : currentViewList ) { if ( ! viewsToModels . containsKey ( view . getViewId ( ) ) ) { viewsToModels . put ( view . getViewId ( ) , modelInfo ) ; } } } return viewsToModels ; }
Naive model to view assignment . The current model is choosen for the first occurence of the view .