JGAP

org.jgap.impl
Class ChainOfSelectors

java.lang.Object
  extended by org.jgap.impl.ChainOfSelectors
All Implemented Interfaces:
java.io.Serializable

public class ChainOfSelectors
extends java.lang.Object
implements java.io.Serializable

Ordered chain of NaturalSelectors. With this container you can plugin NaturalSelector implementations which will be performed either before (pre-) or after (post-selectors) registered genetic operations have been applied.

Since:
1.1
See Also:
Genotype, Configuration, Serialized Form

Constructor Summary
ChainOfSelectors()
           
 
Method Summary
 void addAll(java.util.Collection a_c)
           
 void addNaturalSelector(NaturalSelector a_selector)
          Adds a natural selector to the chain
 void clear()
           
 boolean equals(java.lang.Object a_obj)
           
 NaturalSelector get(int a_index)
          Returns a Selector with specific index in the list
 int hashCode()
           
 boolean isEmpty()
           
 java.util.Iterator iterator()
           
 int size()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChainOfSelectors

public ChainOfSelectors()
Method Detail

addNaturalSelector

public void addNaturalSelector(NaturalSelector a_selector)
                        throws InvalidConfigurationException
Adds a natural selector to the chain

Parameters:
a_selector - the selector to be added
Throws:
InvalidConfigurationException
Since:
1.1 (previously part of class Configuration)

addAll

public void addAll(java.util.Collection a_c)
            throws InvalidConfigurationException
Parameters:
a_c - Collection to add all elements from
Throws:
InvalidConfigurationException
Since:
1.1

size

public int size()
Returns:
number of selectors in list
Since:
1.1 (previously part of class Configuration)

isEmpty

public boolean isEmpty()
Returns:
true if number of selectors is zero
Since:
1.1

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object a_obj)
Overrides:
equals in class java.lang.Object
Parameters:
a_obj - Object
Returns:
boolean
Since:
1.1

get

public NaturalSelector get(int a_index)
Returns a Selector with specific index in the list

Parameters:
a_index - the index of the Selector to read from the list
Returns:
NaturalSelector
Since:
1.1

clear

public void clear()
Since:
1.1

iterator

public java.util.Iterator iterator()
Returns:
Iterator for iterating over list of selectors
Since:
1.1

JGAP