mss.ea.core
Class XMLSink
java.lang.Object
|
+--mss.ea.core.GeneticOperator
|
+--mss.ea.core.XMLSink
- All Implemented Interfaces:
- IndividualSink
- public class XMLSink
- extends GeneticOperator
- implements IndividualSink
A sink that stores individual streams in XML files.
This only a rudimentary version but already working. The SinkOverflowException is thrown after each method call.
- Since:
- 0.1
- Version:
- $Revision: 1.2 $ $Date: 2001/11/12 16:50:27 $
- Author:
- Andreas Rummler
Field Summary |
protected JSX.ObjOut |
xmlprinter
XML printwriter to print to. |
Constructor Summary |
XMLSink(java.io.PrintWriter pw)
Constructor with printwriter. |
XMLSink(java.lang.String file,
boolean append)
Constructor with file. |
Method Summary |
void |
add(java.util.Collection ic)
Writes a collection with individuals to the XML file. |
void |
add(Individual i)
Writes a single individual to the XML file. |
void |
add(Individual[] ia)
Writes an array with individuals to the XML file. |
void |
add(IndividualStream is)
Writes a stream of individuals to the XML file. |
java.lang.Object |
getContents()
Returns always null. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
xmlprinter
protected JSX.ObjOut xmlprinter
- XML printwriter to print to.
XMLSink
public XMLSink(java.io.PrintWriter pw)
- Constructor with printwriter.
- Parameters:
pw
- printwriter to write to
XMLSink
public XMLSink(java.lang.String file,
boolean append)
- Constructor with file.
- Parameters:
file
- file to write toappend
- flag for setting append mode
add
public void add(Individual i)
throws SinkOverflowException
- Writes a single individual to the XML file.
- 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
- Writes an array with individuals to the XML file.
- 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
- Writes a collection with individuals to the XML file.
- Parameters:
ic
- collection of individuals- Throws:
SinkOverflowException
- thrown exactly one method call
add
public void add(IndividualStream is)
throws SinkOverflowException
- Writes a stream of individuals to the XML file.
- 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 always null.
- Specified by:
getContents
in interface IndividualSink
- Returns:
- always null
Copyright © 2000-2001 Technical University of Ilmenau, Department ESS