|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.fernsroth.easyio.field.handler.FieldNumberHandlerBase
public abstract class FieldNumberHandlerBase
Constructor Summary | |
---|---|
FieldNumberHandlerBase(int bits,
boolean unsigned)
constructor. |
Method Summary | |
---|---|
protected abstract java.lang.Object |
createZero()
creates an object with the value of zero. |
protected abstract java.lang.annotation.Annotation |
getAnnotation(java.lang.reflect.Field field)
|
protected int |
getFieldBits(java.lang.reflect.Field field,
java.lang.annotation.Annotation fieldAnnotation)
gets the number of bits for a given field. |
protected abstract java.lang.Object |
read(EasyIOInputStream in)
read data from the input stream. |
void |
read(EasyIOInputStream in,
java.lang.Object obj,
java.util.Queue<java.lang.reflect.Field> fieldsQueue)
reads a field into an object. |
protected abstract void |
write(EasyIOOutputStream out,
java.lang.Object val)
writes a value to the output stream. |
void |
write(EasyIOOutputStream out,
java.lang.Object obj,
java.util.Queue<java.lang.reflect.Field> fieldsQueue)
writes a field into an output stream. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FieldNumberHandlerBase(int bits, boolean unsigned)
bits
- the number of bits in this number.unsigned
- true, for unsigned. false, if not unsigned.Method Detail |
---|
public void read(EasyIOInputStream in, java.lang.Object obj, java.util.Queue<java.lang.reflect.Field> fieldsQueue) throws EasyIOException, java.io.IOException
read
in interface FieldHandler
in
- the input stream to read from.obj
- the object to populate.fieldsQueue
- the queue of all fields (field, is head of queue).
EasyIOException
java.io.IOException
public void write(EasyIOOutputStream out, java.lang.Object obj, java.util.Queue<java.lang.reflect.Field> fieldsQueue) throws EasyIOException, java.io.IOException
write
in interface FieldHandler
out
- the output stream to write the field to.obj
- the object to read from.fieldsQueue
- the queue of fields to read (field, is head of queue).
EasyIOException
java.io.IOException
protected abstract void write(EasyIOOutputStream out, java.lang.Object val) throws java.io.IOException
out
- the output stream to write to.val
- the value to write.
java.io.IOException
protected abstract java.lang.Object createZero()
protected abstract java.lang.Object read(EasyIOInputStream in) throws java.io.IOException
in
- the input stream to read from.
java.io.IOException
protected int getFieldBits(java.lang.reflect.Field field, java.lang.annotation.Annotation fieldAnnotation)
field
- the field to get the number of bits from/fieldAnnotation
- the field annotation.
protected abstract java.lang.annotation.Annotation getAnnotation(java.lang.reflect.Field field)
field
- the field to get the annotation from.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |