Package org.opt4j.operators
Class AbstractGenericOperator.OperatorClassPredicate
- java.lang.Object
-
- org.opt4j.operators.AbstractGenericOperator.OperatorClassPredicate
-
- All Implemented Interfaces:
AbstractGenericOperator.OperatorPredicate
- Enclosing class:
- AbstractGenericOperator<O extends org.opt4j.core.optimizer.Operator<?>,Q extends org.opt4j.core.optimizer.Operator<?>>
public static class AbstractGenericOperator.OperatorClassPredicate extends java.lang.Object implements AbstractGenericOperator.OperatorPredicate
TheAbstractGenericOperator.OperatorClassPredicate
returnstrue
for a given specific class.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.Class<? extends org.opt4j.core.Genotype>
clazz
-
Constructor Summary
Constructors Constructor Description OperatorClassPredicate(java.lang.Class<? extends org.opt4j.core.Genotype> clazz)
Creates a newAbstractGenericOperator.OperatorClassPredicate
for the givenGenotype
class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
boolean
evaluate(org.opt4j.core.Genotype genotype)
Checks whether aGenotype
satisfies the predicate.java.lang.Class<? extends org.opt4j.core.Genotype>
getClazz()
Returns the genotype class for the operator.int
hashCode()
java.lang.String
toString()
-
-
-
Constructor Detail
-
OperatorClassPredicate
public OperatorClassPredicate(java.lang.Class<? extends org.opt4j.core.Genotype> clazz)
Creates a newAbstractGenericOperator.OperatorClassPredicate
for the givenGenotype
class.- Parameters:
clazz
- the class of the genotype
-
-
Method Detail
-
evaluate
public boolean evaluate(org.opt4j.core.Genotype genotype)
Description copied from interface:AbstractGenericOperator.OperatorPredicate
Checks whether aGenotype
satisfies the predicate.- Specified by:
evaluate
in interfaceAbstractGenericOperator.OperatorPredicate
- Parameters:
genotype
- the genotype- Returns:
true
if the predicate is satisfied
-
getClazz
public java.lang.Class<? extends org.opt4j.core.Genotype> getClazz()
Returns the genotype class for the operator.- Returns:
- the genotype class
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
-