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 VgetPrototype()java.lang.StringgetPrototypeType()Type of prototype (Median, Mean, ...) for printing.protected java.lang.StringprototypeToString()Format the prototype as string.java.lang.StringtoString()voidwriteToText(TextWriterStream out, java.lang.String label)Implementation ofTextWriteableinterface.
-
-
-
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:
getPrototypein interfacePrototypeModel<V>- Returns:
- prototype
-
writeToText
public void writeToText(TextWriterStream out, java.lang.String label)
Description copied from interface:PrototypeModelImplementation ofTextWriteableinterface.- Specified by:
writeToTextin interfaceModel- Specified by:
writeToTextin interfacePrototypeModel<V>- Specified by:
writeToTextin 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:PrototypeModelType of prototype (Median, Mean, ...) for printing.- Specified by:
getPrototypeTypein interfacePrototypeModel<V>- Returns:
- String name
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-