org.pfsw.reflect
Class IntegerFieldProxy

java.lang.Object
  extended by org.pfsw.reflect.FieldProxy<T>
      extended by org.pfsw.reflect.NumericFieldProxy<java.lang.Integer>
          extended by org.pfsw.reflect.IntegerFieldProxy
All Implemented Interfaces:
IValueHolder<java.lang.Integer>

public class IntegerFieldProxy
extends NumericFieldProxy<java.lang.Integer>

Provides a field proxy for an integer type which offers some extra convenience methods for basic calculation.


Constructor Summary
IntegerFieldProxy(java.lang.Object owner, java.lang.reflect.Field field)
           
IntegerFieldProxy(java.lang.Object owner, java.lang.String fieldName)
           
 
Method Summary
 java.lang.Integer add(java.lang.Integer value)
          Adds the given value to this field's value and returns the result.
 java.lang.Integer divide(java.lang.Integer value)
          Divides this field's value by the given value, stores the result in the field and returns the result.
 java.lang.Integer multiply(java.lang.Integer value)
          Multiplies this field's value with the given value, stores the result in the field and returns the result.
protected  java.lang.Integer negate(java.lang.Integer value)
          Returns the negated value of the given value.
protected  java.lang.Integer one()
          Returns the representation of 1 as type T.
 
Methods inherited from class org.pfsw.reflect.NumericFieldProxy
changeToValue, dec, inc, subtract
 
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

IntegerFieldProxy

public IntegerFieldProxy(java.lang.Object owner,
                         java.lang.reflect.Field field)

IntegerFieldProxy

public IntegerFieldProxy(java.lang.Object owner,
                         java.lang.String fieldName)
Method Detail

add

public java.lang.Integer add(java.lang.Integer value)
Description copied from class: NumericFieldProxy
Adds the given value to this field's value and returns the result.

Specified by:
add in class NumericFieldProxy<java.lang.Integer>

multiply

public java.lang.Integer multiply(java.lang.Integer value)
Description copied from class: NumericFieldProxy
Multiplies this field's value with the given value, stores the result in the field and returns the result.

Specified by:
multiply in class NumericFieldProxy<java.lang.Integer>

divide

public java.lang.Integer divide(java.lang.Integer value)
Description copied from class: NumericFieldProxy
Divides this field's value by the given value, stores the result in the field and returns the result.

Specified by:
divide in class NumericFieldProxy<java.lang.Integer>

one

protected java.lang.Integer one()
Description copied from class: NumericFieldProxy
Returns the representation of 1 as type T.

Specified by:
one in class NumericFieldProxy<java.lang.Integer>

negate

protected java.lang.Integer negate(java.lang.Integer value)
Description copied from class: NumericFieldProxy
Returns the negated value of the given value.

Specified by:
negate in class NumericFieldProxy<java.lang.Integer>