jnr.ffi.byref
Class AbstractNumberReference<T extends Number>

java.lang.Object
  extended by java.lang.Number
      extended by jnr.ffi.byref.AbstractNumberReference<T>
All Implemented Interfaces:
Serializable, ByReference<T>
Direct Known Subclasses:
ByteByReference, DoubleByReference, FloatByReference, IntByReference, LongLongByReference, NativeLongByReference, NumberByReference, ShortByReference

public abstract class AbstractNumberReference<T extends Number>
extends Number
implements ByReference<T>

An abstract class for common PrimitiveReference functionality

See Also:
Serialized Form

Constructor Summary
protected AbstractNumberReference(T value)
           
 
Method Summary
 byte byteValue()
           
protected static
<T extends Number>
T
checkNull(T value)
           
 double doubleValue()
           
 float floatValue()
           
 T getValue()
          Gets the current value the reference points to.
 int intValue()
           
 long longValue()
           
 short shortValue()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface jnr.ffi.byref.ByReference
fromNative, nativeSize, toNative
 

Constructor Detail

AbstractNumberReference

protected AbstractNumberReference(T value)
Method Detail

checkNull

protected static <T extends Number> T checkNull(T value)

getValue

public T getValue()
Gets the current value the reference points to.

Specified by:
getValue in interface ByReference<T extends Number>
Returns:
the current value.

byteValue

public final byte byteValue()
Overrides:
byteValue in class Number

shortValue

public final short shortValue()
Overrides:
shortValue in class Number

intValue

public final int intValue()
Specified by:
intValue in class Number

longValue

public final long longValue()
Specified by:
longValue in class Number

floatValue

public final float floatValue()
Specified by:
floatValue in class Number

doubleValue

public final double doubleValue()
Specified by:
doubleValue in class Number


Copyright © 2013. All Rights Reserved.