|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sourceforge.cilib.problem.InferiorFitness
public final class InferiorFitness
This class is used to represent a fitness value that is always inferior.
This class is a singleton.
Method Summary | |
---|---|
int |
compareTo(Fitness other)
Returns -1, unless other is also the InferiorFitness instance. |
boolean |
equals(Object object)
Compare the specified object with this type for equality. |
InferiorFitness |
getClone()
Get the cloned instance of this object. |
Double |
getValue()
Always returns null. |
int |
hashCode()
Returns the hash code value for this list. |
static Fitness |
instance()
Obtain a reference to the InferiorFitness instance. |
Fitness |
newInstance(Double value)
Creation method that maintains Fitness object immutability by returning a new instance of the current class type. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public InferiorFitness getClone()
getClone
in interface Fitness
getClone
in interface Type
getClone
in interface Cloneable
Object.clone()
public Double getValue()
InferiorFitness
does not have a value. The
most sensible value to return is Double.NaN as it is still a value, however,
it represents something that is not a number (effectively null). Returning
Double.NaN will ensure that some of the Measurements do get an value, even if
the value is Double.NaN
getValue
in interface Fitness
public final Fitness newInstance(Double value)
newInstance
in interface Fitness
value
- The desired value of the Fitness
object.public int compareTo(Fitness other)
InferiorFitness
instance.
compareTo
in interface Comparable<Fitness>
compareTo
in interface Fitness
other
- The fitness to be compared.
InferiorFitness
instance, -1 otherwise.Comparable
public boolean equals(Object object)
true
if and only if the specified object is also an instance
of the same type.
equals
in interface Type
equals
in class Object
object
- The object to compare.
true
if equality exists, false
otherwise.Object.equals(Object)
public int hashCode()
int hashCode = 7; Iterator<E> i = list.iterator(); while (i.hasNext()) { E obj = i.next(); hashCode = 31*hashCode + (obj==null ? 0 : obj.hashCode()); }This ensures that type1.equals(type2) implies that type1.hashCode()==type2.hashCode() for any two types, type1 and type2, as required by the general contract of
Object.hashCode()
.
hashCode
in interface Type
hashCode
in class Object
Object.equals(Object)
,
Type.equals(Object)
public static Fitness instance()
InferiorFitness
instance.
InferiorFitness
instance.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |