ProgramixGenericLib v5.0.1

com.programix.gui.text
Class IntegerField.RangePair

java.lang.Object
  extended by com.programix.gui.text.IntegerField.RangePair
Enclosing class:
IntegerField

public static class IntegerField.RangePair
extends Object

A pair of IntegerField's that are linked together to specify a range. The maximum value that can be entered into the low-end of the range is constrained by the current value in the high-end of the range. Similarly, the minimum value that can be entered into the high-end of the range is constrained by the current value in the low-end of the range.

Author:
Paul Hyde

Constructor Summary
IntegerField.RangePair(IntegerRange validRange)
           
 
Method Summary
 IntegerField getHighEndField()
           
 IntegerField getLowEndField()
           
 IntegerRange getValidRange()
          Returns the currently valid range of values that can be entered into both fields—this is the entire range.
 IntegerRange getValues()
          Returns the current values of both the 'lo' and 'hi' fields as a range.
 void setValues(Integer loValue, Integer hiValue)
          Allows both the values to be set together as this might be necessary to allow them to both successfully be set.
 void setValues(IntegerRange valueRange)
          Allows both the values to be set together as this might be necessary to allow them to both successfully be set.
 void setValues(int loValue, int hiValue)
          Allows both the values to be set together as this might be necessary to allow them to both successfully be set.
 void setValues(String loValue, String hiValue)
          Allows both the values to be set together as this might be necessary to allow them to both successfully be set.
 void setValues(Value loValue, Value hiValue)
          Allows both the values to be set together as this might be necessary to allow them to both successfully be set.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IntegerField.RangePair

public IntegerField.RangePair(IntegerRange validRange)
Method Detail

getLowEndField

public IntegerField getLowEndField()

getHighEndField

public IntegerField getHighEndField()

getValues

public IntegerRange getValues()
Returns the current values of both the 'lo' and 'hi' fields as a range. This is a handy way to capture both values.


setValues

public void setValues(IntegerRange valueRange)
Allows both the values to be set together as this might be necessary to allow them to both successfully be set. For example, if the new 'lo' is greater than the old 'hi', then the new 'hi' value must be set first (and vice versa).

Parameters:
valueRange - the new lo and new hi values expressed in a range.

setValues

public void setValues(Integer loValue,
                      Integer hiValue)
               throws IllegalArgumentException
Allows both the values to be set together as this might be necessary to allow them to both successfully be set. For example, if the new loValue is greater than the old hiValue, then the new hiValue must be set first to allow the new loValue to be set without modification (and vice versa).

Parameters:
loValue - the new value for the 'lo' field. null is permitted.
hiValue - the new value for the 'hi' field. null is permitted.
Throws:
IllegalArgumentException - if the loValue value is greater than the hiValue value.

setValues

public void setValues(int loValue,
                      int hiValue)
               throws IllegalArgumentException
Allows both the values to be set together as this might be necessary to allow them to both successfully be set. For example, if the new loValue is greater than the old hiValue, then the new hiValue must be set first to allow the new loValue to be set without modification (and vice versa).

Parameters:
loValue - the new value for the 'lo' field.
hiValue - the new value for the 'hi' field.
Throws:
IllegalArgumentException - if the loValue value is greater than the hiValue value.

setValues

public void setValues(String loValue,
                      String hiValue)
               throws IllegalArgumentException
Allows both the values to be set together as this might be necessary to allow them to both successfully be set. For example, if the new loValue is greater than the old hiValue, then the new hiValue must be set first to allow the new loValue to be set without modification (and vice versa).

Parameters:
loValue - the new value for the 'lo' field. null and empty strings are permitted.
hiValue - the new value for the 'hi' field. null and empty strings are permitted.
Throws:
IllegalArgumentException - if the loValue value is greater than the hiValue value.

setValues

public void setValues(Value loValue,
                      Value hiValue)
               throws IllegalArgumentException
Allows both the values to be set together as this might be necessary to allow them to both successfully be set. For example, if the new loValue is greater than the old hiValue, then the new hiValue must be set first to allow the new loValue to be set without modification (and vice versa).

Parameters:
loValue - the new value for the 'lo' field. null and empty values are permitted.
hiValue - the new value for the 'hi' field. null and empty values are permitted.
Throws:
IllegalArgumentException - if the loValue value is greater than the hiValue value.

getValidRange

public IntegerRange getValidRange()
Returns the currently valid range of values that can be entered into both fields—this is the entire range.


ProgramixGenericLib v5.0.1

Copyright © 2001-2009 Programix Incorporated. All rights reserved. ProgramixGenericLib is free and is OSI Certified Open Source Software under the BSD license.