public abstract class NumericFieldProxy<T> extends FieldProxy<T>
Modifier | Constructor and Description |
---|---|
protected |
NumericFieldProxy(java.lang.Object owner,
java.lang.reflect.Field field) |
protected |
NumericFieldProxy(java.lang.Object owner,
java.lang.String fieldName) |
Modifier and Type | Method and Description |
---|---|
abstract T |
add(T value)
Adds the given value to this field's value and returns the result.
|
protected T |
changeToValue(T value) |
T |
dec()
Decrements this field's value by 1, stores the result in the field and returns it.
|
abstract T |
divide(T value)
Divides this field's value by the given value, stores the result
in the field and returns the result.
|
T |
inc()
Increments this field's value by 1, stores the result in the field and returns it.
|
abstract T |
multiply(T value)
Multiplies this field's value with the given value, stores the result
in the field and returns the result.
|
protected abstract T |
negate(T value)
Returns the negated value of the given value.
|
protected abstract T |
one()
Returns the representation of 1 as type T.
|
T |
subtract(T value)
Subtracts the given value from this field's value, stores the result in the field and returns it.
|
protected NumericFieldProxy(java.lang.Object owner, java.lang.reflect.Field field)
protected NumericFieldProxy(java.lang.Object owner, java.lang.String fieldName)
public T inc()
public T dec()
public T subtract(T value)
public abstract T add(T value)
public abstract T multiply(T value)
public abstract T divide(T value)
protected abstract T one()