Evolvica Core API Version 0.6.2
Last Modified: June 29 2004

org.evolvica.core
Interface IIndividualSet

All Superinterfaces:
java.io.Serializable
All Known Subinterfaces:
IPopulation
All Known Implementing Classes:
AbstractIndividualList, AbstractPopulation

public interface IIndividualSet
extends java.io.Serializable

Interface for a set of individuals. Implementing classes are used to hold several individuals together in a collection. In principle this interface is much the same as specified in java.util.Collection, however it has been modified to avoid adding other objects than individuals. Only the most important methods from java.util.Collection have been incorporated, but other methods may be added in the future (i.e. retainAll()). Note: The name set does not specify the underlying data structure, it has only been used because the word set is shorter than the word collection.

Since:
0.4.0
Version:
$Revision: 1.6 $ $Date: 2004/05/26 11:57:54 $
Author:
Andreas Rummler

Method Summary
 void add(IIndividual ind)
          Adds an individual to this set.
 void add(IIndividual[] indArray)
          Adds the individuals from the array to this set.
 void clear()
          Removes all individuals from this set.
 boolean contains(IIndividual ind)
          Checks if the given individual is already contained in this set.
 boolean isEmpty()
          Checks if this set is empty.
 ISetIterator iterator()
          Returns an iterator over this set.
 void remove(IIndividual ind)
          Removes the given individual from this set, if it contained in the set.
 void remove(IIndividual[] indArray)
          Removes all individuals in the given array from this set.
 int size()
          Returns the number of individuals contained in this set.
 IIndividual[] toArray()
          Returns the contents of this set as an array.
 

Method Detail

add

public void add(IIndividual ind)
Adds an individual to this set.

Parameters:
ind - individual to be added

add

public void add(IIndividual[] indArray)
Adds the individuals from the array to this set.

Parameters:
indArray - array with individuals to be added

clear

public void clear()
Removes all individuals from this set.


contains

public boolean contains(IIndividual ind)
Checks if the given individual is already contained in this set.

Parameters:
ind - individual that should be checked
Returns:
true if the given individual is contained in this set, false otherwise

isEmpty

public boolean isEmpty()
Checks if this set is empty.

Returns:
true if this set does not contain any individuals, false otherwise

iterator

public ISetIterator iterator()
Returns an iterator over this set.

Returns:
iterator for this set

remove

public void remove(IIndividual ind)
Removes the given individual from this set, if it contained in the set.

Parameters:
ind - individual to be removed from this set

remove

public void remove(IIndividual[] indArray)
Removes all individuals in the given array from this set.

Parameters:
indArray - array with individuals to be removed

size

public int size()
Returns the number of individuals contained in this set.

Returns:
size of the set

toArray

public IIndividual[] toArray()
Returns the contents of this set as an array.

Returns:
array containing the individuals of this set

Evolvica Core API Version 0.6.2
Last Modified: June 29 2004

Copyright © 2000-2004 Technical University of Ilmenau, Department Electronic Circuits and Systems