Here's my random thoughts,

Is there not a property change even mechanism in java beans as well as
as means to veto a property change if it is constrained and the new
value violates this constraint?  If so there's gotta be a role for it
to play in this situation.

Also if the min value is set to above the max than another approach
might be to slide max to the min value to comply with the constraint.
Likewise if the new max is below the min then slide the max down to
the min value.

> public class Radar {
>         private int minRange = Integer.MIN_VALUE;
> 
>         private int maxRange = Integer.MAX_VALUE;
> 
>         public void setMaxRange (int _maxRange) {
>             if ( _maxRange < minRange ) throw IllegalArgumentException
>             maxRange = _maxRange;
>         }
> 
>         public void setMinRange (int _minRange) {
>             if ( _minRange > maxRange ) throw IllegalArgumentException
>             minRange = _minRange;
>         }
>     }
> }

Alex


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to