AbstractNumericGene
instead. This classes
uses the JScience library, which will be removed in the
next major version.@Deprecated public abstract class NumberGene<N extends Number<N>,G extends NumberGene<N,G>> extends Number<G> implements NumericGene<N,G>, Mean<G>, XMLSerializable
Modifier and Type | Field and Description |
---|---|
protected N |
_max
Deprecated.
The maximum value of this
NumberGene . |
protected N |
_min
Deprecated.
The minimum value of this
NumberGene . |
protected N |
_value
Deprecated.
The value of this
NumberGene . |
Modifier | Constructor and Description |
---|---|
protected |
NumberGene()
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
protected abstract N |
box(Number value)
Deprecated.
Boxes a given Java number into the required number object.
|
int |
compareTo(G that)
Deprecated.
Remind that this method is not consistent with the
equals(Object)
method. |
G |
copy()
Deprecated.
|
double |
doubleValue()
Deprecated.
Returns the value of the specified gene as an double.
|
boolean |
equals(Object obj)
Deprecated.
|
N |
getAllele()
Deprecated.
Return the allele of this gene.
|
N |
getMax()
Deprecated.
Return the allowed max value.
|
N |
getMin()
Deprecated.
Return the allowed min value.
|
N |
getNumber()
Deprecated.
Return the number value of this gene.
|
int |
hashCode()
Deprecated.
|
boolean |
isLargerThan(G that)
Deprecated.
|
boolean |
isValid()
Deprecated.
Test whether this is a valid NumberGene and its value is within the
interval closed interval [min, max].
|
long |
longValue()
Deprecated.
Returns the value of the specified gene as an long.
|
abstract G |
newInstance(N value)
Deprecated.
Create a new gene from the given
value . |
G |
newInstance(Number value)
Deprecated.
Create a new NumberGene with the same limits and the given value.
|
G |
opposite()
Deprecated.
|
G |
plus(G that)
Deprecated.
|
protected void |
set(N value,
N min,
N max)
Deprecated.
Set the
NumberGene . |
G |
times(G that)
Deprecated.
|
Text |
toText()
Deprecated.
|
byteValue, floatValue, intValue, isGreaterThan, isLessThan, minus, pow, shortValue, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
byteValue, floatValue, intValue, shortValue
newInstance
protected transient N extends Number<N> _min
NumberGene
. This field is marked
as transient and must serialized manually by sub classes.protected transient N extends Number<N> _max
NumberGene
. This field is marked
as transient and must serialized manually by sub classes.protected NumberGene()
protected abstract N box(Number value)
value
- the Java number to box.public abstract G newInstance(N value)
value
.newInstance
in interface BoundedGene<N extends Number<N>,G extends NumberGene<N,G>>
value
- the value of the new gene.public G newInstance(Number value)
newInstance
in interface NumericGene<N extends Number<N>,G extends NumberGene<N,G>>
value
- The value of the new NumberGene.NullPointerException
- if the given value
is null
.protected void set(N value, N min, N max)
NumberGene
.value
- The value of the number gene.min
- The allowed min value of the gene.max
- The allows max value of the gene.NullPointerException
- if one of the given number is null.public boolean isValid()
isValid
in interface Verifiable
public N getNumber()
public N getAllele()
Gene
public N getMin()
getMin
in interface BoundedGene<N extends Number<N>,G extends NumberGene<N,G>>
public N getMax()
getMax
in interface BoundedGene<N extends Number<N>,G extends NumberGene<N,G>>
public double doubleValue()
NumericGene
doubleValue
in interface NumericGene<N extends Number<N>,G extends NumberGene<N,G>>
doubleValue
in class Number<G extends NumberGene<N,G>>
double
.public long longValue()
NumericGene
longValue
in interface NumericGene<N extends Number<N>,G extends NumberGene<N,G>>
longValue
in class Number<G extends NumberGene<N,G>>
long
.public boolean isLargerThan(G that)
isLargerThan
in class Number<G extends NumberGene<N,G>>
public G plus(G that)
plus
in interface GroupAdditive<G extends NumberGene<N,G>>
public G opposite()
opposite
in interface GroupAdditive<G extends NumberGene<N,G>>
public int compareTo(G that)
equals(Object)
method. Since this method only compares the value
and the
equals
method also takes the min
and max
value
into account.
final NumberGene〈?, ?〉 ng1 = ...
final NumberGene〈?, ?〉 ng2 = ...
if (ng1.equals(ng2) {
// Holds for every ng1 and ng2.
assert(ng1.compareTo(ng2) == 0);
}
if (ng1.compareTo(ng2) == 0) {
// Doesn't hold for every ng1 and ng2.
assert(ng1.equals(ng2));
}
compareTo
in interface Comparable<G extends NumberGene<N,G>>
compareTo
in class Number<G extends NumberGene<N,G>>
public int hashCode()
© 2007-2014 Franz Wilhelmstötter (2014-03-07 19:35)