N
- the number typepublic abstract class NumberPropertyEditor<N extends Number & Comparable<N>> extends PropertyEditor<N> implements Comparator<N>
Modifier and Type | Class and Description |
---|---|
static class |
NumberPropertyEditor.BigDecimalPropertyEditor
A number property editor for use with
BigDecimal . |
static class |
NumberPropertyEditor.BigIntegerPropertyEditor
A number property editor for use with
BigInteger . |
static class |
NumberPropertyEditor.DoublePropertyEditor
A number property editor for use with
Double . |
static class |
NumberPropertyEditor.FloatPropertyEditor
A number property editor for use with
Float . |
static class |
NumberPropertyEditor.IntegerPropertyEditor
A number property editor for use with
Integer . |
static class |
NumberPropertyEditor.LongPropertyEditor
A number property editor for use with
Long . |
static class |
NumberPropertyEditor.ShortPropertyEditor
A number property editor for use with
Short . |
Modifier and Type | Field and Description |
---|---|
protected String |
alphaRegex |
protected String |
currencySymbolRegex |
protected NumberFormat |
format |
protected String |
groupSeparator |
protected NumberConstants |
numbers |
DEFAULT
Constructor and Description |
---|
NumberPropertyEditor(N incrAmount)
Creates a new number property editor with the default number type (Double).
|
NumberPropertyEditor(NumberFormat format,
N incrAmount)
Creates a new number property editor.
|
Modifier and Type | Method and Description |
---|---|
int |
compare(N n1,
N n2)
Compares the first value with the second value using the objects natural compareTo.
|
N |
decr(N value)
Decrements a value by the current increment amount.
|
protected abstract N |
doDecr(N value) |
protected abstract N |
doIncr(N value) |
NumberFormat |
getFormat()
Returns the editor's format.
|
N |
getIncrement()
Gets the current increment amount.
|
N |
incr(N value)
Increments a value by the current increment amount.
|
N |
parse(CharSequence text) |
protected abstract N |
parseString(String string) |
String |
render(Number value) |
protected abstract N |
returnTypedValue(Number number) |
void |
setFormat(NumberFormat format)
Sets the editor's format.
|
void |
setIncrement(N value)
Sets the increment amount (defaults to zero).
|
protected String |
stripValue(String value) |
render
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
comparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
protected NumberConstants numbers
protected NumberFormat format
protected String alphaRegex
protected String currencySymbolRegex
protected String groupSeparator
public NumberPropertyEditor(N incrAmount)
public NumberPropertyEditor(NumberFormat format, N incrAmount)
format
- the number formatpublic int compare(N n1, N n2)
compare
in interface Comparator<N extends Number & Comparable<N>>
n1
- first numbern2
- second numberpublic N decr(N value)
value
- the value to decrementpublic NumberFormat getFormat()
public N getIncrement()
public N incr(N value)
value
- the value to incrementpublic N parse(CharSequence text) throws ParseException
ParseException
public void setFormat(NumberFormat format)
format
- the formatpublic void setIncrement(N value)
value
- the new increment amountCopyright © 2018. All rights reserved.