Package elki.data.model
Class SimplePrototypeModel<V>
- java.lang.Object
-
- elki.data.model.SimplePrototypeModel<V>
-
- All Implemented Interfaces:
Model
,PrototypeModel<V>
,TextWriteable
- Direct Known Subclasses:
CorrelationModel
,MeanModel
,MedoidModel
public class SimplePrototypeModel<V> extends java.lang.Object implements PrototypeModel<V>, TextWriteable
Cluster model that stores a prototype for each cluster.- Since:
- 0.7.0
- Author:
- Erich Schubert
-
-
Constructor Summary
Constructors Constructor Description SimplePrototypeModel(V prototype)
Constructor with prototype
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description V
getPrototype()
java.lang.String
getPrototypeType()
Type of prototype (Median, Mean, ...) for printing.protected java.lang.String
prototypeToString()
Format the prototype as string.java.lang.String
toString()
void
writeToText(TextWriterStream out, java.lang.String label)
Implementation ofTextWriteable
interface.
-
-
-
Field Detail
-
prototype
protected V prototype
Cluster prototype
-
-
Constructor Detail
-
SimplePrototypeModel
public SimplePrototypeModel(V prototype)
Constructor with prototype- Parameters:
prototype
- Cluster prototype
-
-
Method Detail
-
getPrototype
public V getPrototype()
- Specified by:
getPrototype
in interfacePrototypeModel<V>
- Returns:
- prototype
-
writeToText
public void writeToText(TextWriterStream out, java.lang.String label)
Description copied from interface:PrototypeModel
Implementation ofTextWriteable
interface.- Specified by:
writeToText
in interfaceModel
- Specified by:
writeToText
in interfacePrototypeModel<V>
- Specified by:
writeToText
in interfaceTextWriteable
- Parameters:
out
- Output steamlabel
- Optional label to prefix
-
prototypeToString
protected java.lang.String prototypeToString()
Format the prototype as string.- Returns:
- Prototype
-
getPrototypeType
public java.lang.String getPrototypeType()
Description copied from interface:PrototypeModel
Type of prototype (Median, Mean, ...) for printing.- Specified by:
getPrototypeType
in interfacePrototypeModel<V>
- Returns:
- String name
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-