Mp3dings 
20100427

de.mospace.swing.text
Class NumericInputVerifier

java.lang.Object
  extended by javax.swing.InputVerifier
      extended by de.mospace.swing.text.NumericInputVerifier
All Implemented Interfaces:
Serializable

Deprecated. use GeneralInputVerifier instead

public class NumericInputVerifier
extends InputVerifier
implements Serializable

An input verifier that checks if a text component's text can be interpreted as a particular sub-class of number and if it falls into the allowed range of numbers.

Version:
$Revision: 12 $ ($Date: 2007-07-27 11:48:53 +0200 (Fr, 27 Jul 2007) $)
Author:
Moritz Ringler
See Also:
Serialized Form

Constructor Summary
NumericInputVerifier(Class c)
          Deprecated. Constructs a new NumericInputVerifier for the full range of numbers in the given sub-class of Number.
NumericInputVerifier(Class c, Comparable min, Comparable max)
          Deprecated. Constructs a new NumericInputVerifier for the given sub-class of Number and the given limits.
 
Method Summary
 Exception explain()
          Deprecated. Explains why the last call to verify(javax.swing.JComponent) returned false.
 Comparable getLowerLimit()
          Deprecated. Returns the smallest allowed number.
 Class getNumberClass()
          Deprecated. Returns the class against which input will be checked.
 Comparable getUpperLimit()
          Deprecated. Returns the largest allowed number.
 void setLowerLimit(Comparable min)
          Deprecated. Sets the smallest allowed number.
 void setNumberClass(Class c)
          Deprecated. Sets the class against which input will be checked.
 void setUpperLimit(Comparable max)
          Deprecated. Sets the largest allowed number.
 boolean verify(JComponent input)
          Deprecated.  
 
Methods inherited from class javax.swing.InputVerifier
shouldYieldFocus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NumericInputVerifier

public NumericInputVerifier(Class c,
                            Comparable min,
                            Comparable max)
Deprecated. 
Constructs a new NumericInputVerifier for the given sub-class of Number and the given limits.

Parameters:
c - the sub-class of number that input will be interpreted as
min - lower limit. null for none.
max - upper limit. null for none.
Throws:
IllegalArgumentException - if c does not implement Number, or if it does not have a static valueOf(String) method or a single argument string constructor.
ClassCastException - if min and max are not null or instances of c.

NumericInputVerifier

public NumericInputVerifier(Class c)
Deprecated. 
Constructs a new NumericInputVerifier for the full range of numbers in the given sub-class of Number.

Parameters:
c - the sub-class of number that input will be interpreted as
Throws:
IllegalArgumentException - if c does not implement Number, or if it does not have a static valueOf(String) method or a constructor with a single String argument
Method Detail

getNumberClass

public Class getNumberClass()
Deprecated. 
Returns the class against which input will be checked.

See Also:
setNumberClass(java.lang.Class)

setNumberClass

public void setNumberClass(Class c)
Deprecated. 
Sets the class against which input will be checked. This will automatically reset the allowed range to the full range of numbers in this class.

Parameters:
c - the sub-class of number that input will be interpreted as
Throws:
IllegalArgumentException - if c does not implement Number, or if it does not have a static valueOf(String) method or a single argument string constructor.

setUpperLimit

public void setUpperLimit(Comparable max)
Deprecated. 
Sets the largest allowed number.

Parameters:
max - upper limit. null for none.
Throws:
ClassCastException - if max is not null or an instance of getNumberClass.

getUpperLimit

public Comparable getUpperLimit()
Deprecated. 
Returns the largest allowed number.

Returns:
upper limit. null for none.

setLowerLimit

public void setLowerLimit(Comparable min)
Deprecated. 
Sets the smallest allowed number.

Parameters:
min - lower limit. null for none.
Throws:
ClassCastException - if min is not null or an instance of getNumberClass.

explain

public Exception explain()
Deprecated. 
Explains why the last call to verify(javax.swing.JComponent) returned false. If the last call to verify returned false, this method will return

Returns:
an Exception or null

getLowerLimit

public Comparable getLowerLimit()
Deprecated. 
Returns the smallest allowed number.

Returns:
lower limit. null for none.

verify

public boolean verify(JComponent input)
Deprecated. 
Specified by:
verify in class InputVerifier
Throws:
IllegalArgumentException - if input is not a JTextComponent

Mp3dings 
20100427