Package jadex.binary
Class NumberCodec
- java.lang.Object
- 
- jadex.binary.AbstractCodec
- 
- jadex.binary.NumberCodec
 
 
- 
- All Implemented Interfaces:
- IDecoderHandler,- ITraverseProcessor
 
 public class NumberCodec extends AbstractCodec Codec for encoding and decoding numbers (short, integer, float, etc.), boolean values and char values.
- 
- 
Field SummaryFields Modifier and Type Field Description static NumberCodecINSTANCEDefault Instanceprotected static java.util.Set<java.lang.Class<?>>TYPESThe types this processor can handle.
 - 
Constructor SummaryConstructors Constructor Description NumberCodec()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanReference(java.lang.Object object, java.lang.Class<?> clazz, IEncodingContext ec)Prevent references for primitive-wrapped types.java.lang.ObjectcreateObject(java.lang.Class<?> clazz, IDecodingContext context)Creates the object during decoding.java.lang.Objectencode(java.lang.Object object, java.lang.Class<?> clazz, java.util.List<ITraverseProcessor> preprocessors, java.util.List<ITraverseProcessor> processors, Traverser.MODE mode, Traverser traverser, java.lang.ClassLoader targetcl, IEncodingContext ec)Encode the object.booleanisApplicable(java.lang.Class<?> clazz)Tests if the decoder can decode the class.voidrecordKnownDecodedObject(java.lang.Object object, IDecodingContext context)References handling not needed.- 
Methods inherited from class jadex.binary.AbstractCodecdecode, decodeSubObjects, isApplicable, isFixedFrame, process
 
- 
 
- 
- 
- 
Field Detail- 
INSTANCEpublic static final NumberCodec INSTANCE Default Instance
 - 
TYPESprotected static final java.util.Set<java.lang.Class<?>> TYPES The types this processor can handle.
 
- 
 - 
Method Detail- 
isApplicablepublic boolean isApplicable(java.lang.Class<?> clazz) Tests if the decoder can decode the class.- Specified by:
- isApplicablein interface- IDecoderHandler
- Specified by:
- isApplicablein class- AbstractCodec
- Parameters:
- clazz- The class.
- Returns:
- True, if the decoder can decode this class.
 
 - 
createObjectpublic java.lang.Object createObject(java.lang.Class<?> clazz, IDecodingContext context)Creates the object during decoding.- Specified by:
- createObjectin class- AbstractCodec
- Parameters:
- clazz- The class of the object.
- context- The decoding context.
- Returns:
- The created object.
 
 - 
recordKnownDecodedObjectpublic void recordKnownDecodedObject(java.lang.Object object, IDecodingContext context)References handling not needed.- Overrides:
- recordKnownDecodedObjectin class- AbstractCodec
 
 - 
encodepublic java.lang.Object encode(java.lang.Object object, java.lang.Class<?> clazz, java.util.List<ITraverseProcessor> preprocessors, java.util.List<ITraverseProcessor> processors, Traverser.MODE mode, Traverser traverser, java.lang.ClassLoader targetcl, IEncodingContext ec)Encode the object.- Specified by:
- encodein class- AbstractCodec
 
 - 
canReferencepublic boolean canReference(java.lang.Object object, java.lang.Class<?> clazz, IEncodingContext ec)Prevent references for primitive-wrapped types.- Overrides:
- canReferencein class- AbstractCodec
- Parameters:
- object- The current object.
- clazz- The class.
- ec- The encoding context.
- Returns:
- True, if a reference has been encoded, false otherwise.
 
 
- 
 
-