|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectorg.pfsw.reflect.FieldProxy<T>
org.pfsw.reflect.NumericFieldProxy<T>
public abstract class NumericFieldProxy<T>
Provides an abstract field proxy for numeric types which offers some extra convenience methods for basic calculation.
| Constructor Summary | |
|---|---|
protected |
NumericFieldProxy(java.lang.Object owner,
java.lang.reflect.Field field)
|
protected |
NumericFieldProxy(java.lang.Object owner,
java.lang.String fieldName)
|
| Method Summary | |
|---|---|
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. |
| Methods inherited from class org.pfsw.reflect.FieldProxy |
|---|
get, getField, getOwner, isNull, isPresent, set |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected NumericFieldProxy(java.lang.Object owner,
java.lang.reflect.Field field)
protected NumericFieldProxy(java.lang.Object owner,
java.lang.String fieldName)
| Method Detail |
|---|
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 negate(T value)
protected abstract T one()
protected T changeToValue(T value)
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||