public class TextWriter
extends java.lang.Object
Note: these classes need to be redesigned. Contributions welcome!
Modifier and Type | Field and Description |
---|---|
private TextWriterWriterInterface<?> |
fallback
Fallback writer for unknown objects.
|
static java.lang.String |
FILE_EXTENSION
Extension for txt-files.
|
protected java.util.Map<java.lang.String,java.lang.Object> |
filenames
For producing unique filenames.
|
static HandlerList<TextWriterWriterInterface<?>> |
writers
Hash map for supported classes in writer.
|
Constructor and Description |
---|
TextWriter() |
Modifier and Type | Method and Description |
---|---|
private java.lang.String |
filenameFromLabel(java.lang.String label)
Derive a file name from the cluster label.
|
protected java.lang.String |
getFilename(java.lang.Object result,
java.lang.String filenamepre)
Try to find a unique file name.
|
void |
output(Database db,
Result r,
StreamFactory streamOpener,
java.util.regex.Pattern filter)
Stream output.
|
private void |
printObject(TextWriterStream out,
Database db,
DBIDRef objID,
java.util.List<Relation<?>> ra) |
private void |
writeClusterResult(Database db,
StreamFactory streamOpener,
Clustering<Model> clustering,
Cluster<Model> clus,
java.util.List<Relation<?>> ra,
NamingScheme naming) |
private void |
writeIterableResult(StreamFactory streamOpener,
IterableResult<?> ri) |
private void |
writeOrderingResult(Database db,
StreamFactory streamOpener,
OrderingResult or,
java.util.List<Relation<?>> ra) |
private void |
writeOtherResult(StreamFactory streamOpener,
Result r) |
private void |
writeSettingsResult(StreamFactory streamOpener,
java.util.List<SettingsResult> rs) |
public static final java.lang.String FILE_EXTENSION
public static final HandlerList<TextWriterWriterInterface<?>> writers
protected java.util.Map<java.lang.String,java.lang.Object> filenames
private TextWriterWriterInterface<?> fallback
protected java.lang.String getFilename(java.lang.Object result, java.lang.String filenamepre)
result
- Result we printfilenamepre
- File name prefix to usepublic void output(Database db, Result r, StreamFactory streamOpener, java.util.regex.Pattern filter) throws java.io.IOException
db
- Database objectr
- Result classstreamOpener
- output stream managerfilter
- Filter patternjava.io.IOException
- on IO errorprivate void printObject(TextWriterStream out, Database db, DBIDRef objID, java.util.List<Relation<?>> ra) throws java.io.IOException
java.io.IOException
private void writeClusterResult(Database db, StreamFactory streamOpener, Clustering<Model> clustering, Cluster<Model> clus, java.util.List<Relation<?>> ra, NamingScheme naming) throws java.io.FileNotFoundException, java.io.IOException
java.io.FileNotFoundException
java.io.IOException
private void writeIterableResult(StreamFactory streamOpener, IterableResult<?> ri) throws java.io.IOException
java.io.IOException
private void writeOrderingResult(Database db, StreamFactory streamOpener, OrderingResult or, java.util.List<Relation<?>> ra) throws java.io.IOException
java.io.IOException
private void writeSettingsResult(StreamFactory streamOpener, java.util.List<SettingsResult> rs) throws java.io.IOException
java.io.IOException
private void writeOtherResult(StreamFactory streamOpener, Result r) throws java.io.IOException
java.io.IOException
private java.lang.String filenameFromLabel(java.lang.String label)
label
- cluster labelCopyright © 2019 ELKI Development Team. License information.