class MapContent {

    public void dispose(){
        if( this.mapListeners != null ){
            this.mapListeners.clear();
            this.mapListeners = null;
        }
        if( this.layerList != null ){
            // remove mapListeners prior to removing layers
           for( Layer layer : layerList ){
               if( layer == null ) continue;
               if( this.layerListener != null ){
                   layer.removeMapLayerListener(layerListener);
               }
               layer.dispose();
           }
           layerList.clear();
           layerList = null;
       }
       if( this.layerListener != null ){
           this.layerListener = null;
       }
       
       if( this.propertyListeners != null ){
           this.propertyListeners.clear();
           this.propertyListeners = null;
       }
       this.title = null;
       if( this.userData != null ){
           // remove property listeners prior to removing userData
           this.userData.clear();
           this.userData = null;
       }
    }

    public  MapContent();
    public  MapContent(MapContext context);
    @Deprecated public  MapContent(CoordinateReferenceSystem crs);
    @Deprecated public  MapContent(MapLayer[] array);
    @Deprecated public  MapContent(MapLayer[] array, CoordinateReferenceSystem crs);
    @Deprecated public  MapContent(MapLayer[] array, String title, String contextAbstract, String contactInformation,
            String[] keywords);
    @Deprecated public  MapContent(MapLayer[] array, String title, String contextAbstract, String contactInformation,
            String[] keywords, final CoordinateReferenceSystem crs);

}