|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.vizzini.math.BinaryEncoder
public class BinaryEncoder
Provides an encoder for binary numbers.
| Constructor Summary | |
|---|---|
BinaryEncoder(double max)
Construct this object with the given parameter. |
|
BinaryEncoder(double min,
double max)
Construct this object with the given parameters. |
|
BinaryEncoder(double min,
double max,
double delta)
Construct this object with the given parameters. |
|
| Method Summary | |
|---|---|
static int |
computeDigits(double range,
double delta)
Compute the number of binary digits required to hold the given range. |
double |
decode(double[] value)
Decode the given value as a base-10 number. |
double |
decode(String value)
Decode the given value as a base-10 number. |
BitSet |
encodeAsBitSet(double value)
Encode the given value as a binary number. |
double[] |
encodeAsDoubleArray(double value)
Encode the given value as a binary number. |
int[] |
encodeAsIntArray(double value)
Encode the given value as a binary number. |
String |
encodeAsString(double value)
Encode the given value as a binary number. |
double |
getDelta()
|
int |
getLength()
|
double |
getMax()
|
double |
getMin()
|
double |
getRange()
|
protected void |
setDelta(double delta)
|
protected void |
setLength(int length)
|
protected void |
setMax(double max)
|
protected void |
setMin(double min)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BinaryEncoder(double max)
max - Maximum value.
public BinaryEncoder(double min,
double max)
min - Minimum value.max - Maximum value.
public BinaryEncoder(double min,
double max,
double delta)
min - Minimum value.max - Maximum value.delta - Delta value, or required precision.| Method Detail |
|---|
public static int computeDigits(double range,
double delta)
range - Range.public double decode(double[] value)
public double decode(String value)
public BitSet encodeAsBitSet(double value)
value - Value.public double[] encodeAsDoubleArray(double value)
value - Value.public int[] encodeAsIntArray(double value)
value - Value.public String encodeAsString(double value)
value - Value.public double getDelta()
public int getLength()
public double getMax()
public double getMin()
public double getRange()
protected void setDelta(double delta)
delta - the delta to setprotected void setLength(int length)
length - the length to setprotected void setMax(double max)
max - the max to setprotected void setMin(double min)
min - the min to set
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
| Copyright © 2007 Vizzini.org. All Rights Reserved. | 2007.12.25.03.00.02 |