|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjenes.chromosome.BitwiseChromosome.BitCoding<java.lang.Integer>
jenes.chromosome.codings.ShortCoding
public class ShortCoding
Represents a short coding with 16 bits. There are two possible representations: the two complement ond and the module and sign one. The range representable with the former is [-32768,32767]; the one representable with the latter is [-32767,32767] (the difference is the latter provides two different codes to represent the 0).
ByteCoding
,
IntCoding
,
GrayCoding
,
WordCoding
,
BitwiseChromosome.BitSize
,
BooleanCoding
Nested Class Summary | |
---|---|
static class |
ShortCoding.Mode
The integer coding representations |
Field Summary |
---|
Fields inherited from class jenes.chromosome.BitwiseChromosome.BitCoding |
---|
SIZE |
Constructor Summary | |
---|---|
ShortCoding()
Default constructor. |
|
ShortCoding(ShortCoding.Mode mode)
Creates a ShortCoding with the specified mode, that is the number representation scheme. |
Method Summary | |
---|---|
java.lang.Integer |
decode(int bits)
Returns the value of coded bits |
int |
encode(java.lang.Integer value)
Returns the bits coding the value |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ShortCoding()
public ShortCoding(ShortCoding.Mode mode)
mode
- can be two's complement or module and sign.Method Detail |
---|
public final java.lang.Integer decode(int bits)
decode
in class BitwiseChromosome.BitCoding<java.lang.Integer>
bits
- coding the value
public final int encode(java.lang.Integer value)
encode
in class BitwiseChromosome.BitCoding<java.lang.Integer>
value
- the value to be coded
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |