|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectHolder
class Holder
Class used to convert a floating point number into a fixed point representation of a specified number of bits and to provide methods for accessing the representation.
Field Summary | |
---|---|
private Representation |
decimalRepresentation
|
private Representation |
fractionRepresentation
|
private boolean |
negative
|
private int |
numberBits
|
Constructor Summary | |
---|---|
Holder(int numberBits,
double number)
Class constructor converts a double number into a binary representation with the specified number of bits. |
Method Summary | |
---|---|
Representation |
getDecimalRepresentation()
Return a representation of the decimal portion of the floating point number. |
Representation |
getFractionRepresentation()
Return a representation of the fraction portion of the floating point number. |
int |
getNumberBits()
Get the number of bits in the representation |
void |
setDecimalRepresentation(Representation representation)
Set the decimal internal representation |
void |
setFractionRepresentation(Representation representation)
Set the fraction internal representation |
java.lang.String |
toString()
Convert internal representations into a String for display. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private int numberBits
private boolean negative
private Representation decimalRepresentation
private Representation fractionRepresentation
Constructor Detail |
---|
public Holder(int numberBits, double number)
numberBits
- number of bits to use in the binary representationnumber
- double number to convert into binaryMethod Detail |
---|
public java.lang.String toString()
toString
in class java.lang.Object
public int getNumberBits()
public Representation getDecimalRepresentation()
public void setDecimalRepresentation(Representation representation)
representation
- object containing the representationpublic Representation getFractionRepresentation()
public void setFractionRepresentation(Representation representation)
representation
- object containing the representation
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |