eaLib API Docs
Last Modified : January 7 2002

mss.ea.core
Class GenericSink

java.lang.Object
  |
  +--mss.ea.core.GeneticOperator
        |
        +--mss.ea.core.GenericSink
All Implemented Interfaces:
IndividualSink

public class GenericSink
extends GeneticOperator
implements IndividualSink

Base class for a generic individual sink. This sink allows exactly one storage operation. The added individuals are stored inside a list and a SinkOverflowException is thrown afterwards as a notification that this sink has received individuals.

Since:
0.1
Version:
$Revision: 1.4 $ $Date: 2001/11/12 16:51:10 $
Author:
Andreas Rummler

Field Summary
protected  java.util.LinkedList sink
          Lists with individuals, serves as a buffer.
 
Fields inherited from class mss.ea.core.GeneticOperator
description, ID, name
 
Constructor Summary
GenericSink()
          Constructor.
 
Method Summary
 void add(java.util.Collection ic)
          Adds a collection with individuals to the sink.
 void add(Individual i)
          Adds an individual.
 void add(Individual[] ia)
          Adds an array with individuals to the sink.
 void add(IndividualStream is)
          Adds a stream of individuals to this population.
 java.lang.Object getContents()
          Returns a linked list with contents of this sink.
 
Methods inherited from class mss.ea.core.GeneticOperator
getDescription, getID, getName, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

sink

protected java.util.LinkedList sink
Lists with individuals, serves as a buffer.
Constructor Detail

GenericSink

public GenericSink()
Constructor.
Method Detail

add

public void add(Individual i)
         throws SinkOverflowException
Adds an individual.
Specified by:
add in interface IndividualSink
Parameters:
i - individual to add
Throws:
SinkOverflowException - thrown exactly one method call

add

public void add(Individual[] ia)
         throws SinkOverflowException
Adds an array with individuals to the sink.
Specified by:
add in interface IndividualSink
Parameters:
ia - array with individuals
Throws:
SinkOverflowException - thrown exactly one method call

add

public void add(java.util.Collection ic)
         throws SinkOverflowException
Adds a collection with individuals to the sink.
Parameters:
ic - collection of individuals
Throws:
SinkOverflowException - thrown exactly one method call

add

public void add(IndividualStream is)
         throws SinkOverflowException
Adds a stream of individuals to this population.
Specified by:
add in interface IndividualSink
Parameters:
is - stream with individuals
Throws:
SinkOverflowException - thrown exactly one method call

getContents

public java.lang.Object getContents()
Returns a linked list with contents of this sink.
Specified by:
getContents in interface IndividualSink
Returns:
linked list with contents

eaLib API Docs
Last Modified : January 7 2002

Copyright © 2000-2001 Technical University of Ilmenau, Department ESS