public boolean addDimensionIfNotExists ( Dimension dim ) { if ( immutable ) throw new IllegalStateException ( "Cant modify" ) ; if ( ! dim . isShared ( ) ) { throw new IllegalArgumentException ( "Dimensions added to a group must be shared." ) ; } if ( findDimensionLocal ( dim . getShortName ( ) ) != null ) return false ; dimensions . add ( dim ) ; dim . setGroup ( this ) ; return true ; }
Adds the specified shared dimension to this group but only if another dimension with the same name doesn t already exist .