|
|
|||||||||||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.lmu.ifi.dbs.elki.data.AbstractDatabaseObject
de.lmu.ifi.dbs.elki.data.cluster.Cluster<M>
M
- Model object typepublic class Cluster<M extends Model>
Generic cluster class, that may or not have hierarchical information. Note that every cluster MUST have a DatabaseObjectGroup, since it implements the interface, too. Calls to the interface are proxied to the inner group object. A hierarchy object of class SimpleHierarchy will be created automatically when a list of parents and children is provided. Alternatively, a pre-existing hierarchy object can be provided, e.g. when there is a single hierarchy object used for keeping all the hierarchy information in one object.
Field Summary | |
---|---|
private DatabaseObjectGroup |
group
Cluster data. |
private HierarchyImplementation<Cluster<M>> |
hierarchy
Object that the hierarchy management is delegated to. |
private M |
model
Cluster model. |
protected String |
name
Cluster name. |
private boolean |
noise
Noise? |
Constructor Summary | |
---|---|
Cluster(DatabaseObjectGroup group)
Constructor without hierarchy information and name and model |
|
Cluster(DatabaseObjectGroup group,
boolean noise)
Constructor without hierarchy information and name and model |
|
Cluster(DatabaseObjectGroup group,
boolean noise,
M model)
Constructor without hierarchy information and name |
|
Cluster(DatabaseObjectGroup group,
M model)
Constructor without hierarchy information and name |
|
Cluster(String name,
DatabaseObjectGroup group)
Constructor without hierarchy information and model |
|
Cluster(String name,
DatabaseObjectGroup group,
boolean noise)
Constructor without hierarchy information and model |
|
Cluster(String name,
DatabaseObjectGroup group,
boolean noise,
M model)
Constructor without hierarchy information. |
|
Cluster(String name,
DatabaseObjectGroup group,
boolean noise,
M model,
HierarchyImplementation<Cluster<M>> hierarchy)
Full constructor |
|
Cluster(String name,
DatabaseObjectGroup group,
boolean noise,
M model,
List<Cluster<M>> children,
List<Cluster<M>> parents)
Constructor with hierarchy information. |
|
Cluster(String name,
DatabaseObjectGroup group,
M model)
Constructor without hierarchy information. |
|
Cluster(String name,
DatabaseObjectGroup group,
M model,
HierarchyImplementation<Cluster<M>> hierarchy)
Constructor with hierarchy but noise flag defaulting to false. |
|
Cluster(String name,
DatabaseObjectGroup group,
M model,
List<Cluster<M>> children,
List<Cluster<M>> parents)
Constructor with hierarchy information, but no noise flag. |
Method Summary | ||
---|---|---|
|
getAncestors(T collection)
Delegate to hierarchy object |
|
List<Cluster<M>> |
getChildren()
Delegate to hierarchy object |
|
Set<Cluster<M>> |
getDescendants()
Collect descendants |
|
|
getDescendants(T collection)
Delegate to hierarchy object |
|
DatabaseObjectGroup |
getGroup()
Access group object |
|
HierarchyImplementation<Cluster<M>> |
getHierarchy()
Get hierarchy object |
|
Collection<Integer> |
getIDs()
Delegate to group. |
|
M |
getModel()
Access model object |
|
String |
getName()
Get Cluster name. |
|
String |
getNameAutomatic()
Return either the assigned name or the suggested label |
|
List<Cluster<M>> |
getParents()
Delegate to hierarchy object |
|
boolean |
isHierarchical()
Test hierarchy |
|
boolean |
isNoise()
Getter for noise flag. |
|
Iterator<Integer> |
iterator()
Delegate to group. |
|
int |
numChildren()
Delegate to hierarchy object |
|
int |
numParents()
Delegate to hierarchy object |
|
void |
setGroup(DatabaseObjectGroup g)
Access group object |
|
void |
setHierarchy(HierarchyImplementation<Cluster<M>> hierarchy)
Set hierarchy object |
|
void |
setModel(M model)
Access model object |
|
void |
setName(String name)
Set Cluster name |
|
void |
setNoise(boolean noise)
Setter for noise flag. |
|
int |
size()
Delegate to database object group. |
|
void |
writeToText(TextWriterStream out,
String label)
Write to a textual representation. |
Methods inherited from class de.lmu.ifi.dbs.elki.data.AbstractDatabaseObject |
---|
getID, setID |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface de.lmu.ifi.dbs.elki.data.DatabaseObject |
---|
equals |
Field Detail |
---|
private HierarchyImplementation<Cluster<M extends Model>> hierarchy
protected String name
private DatabaseObjectGroup group
private M extends Model model
private boolean noise
Constructor Detail |
---|
public Cluster(String name, DatabaseObjectGroup group, boolean noise, M model, HierarchyImplementation<Cluster<M>> hierarchy)
name
- Cluster name. May be null.group
- Group datanoise
- Noise flagmodel
- Model. May be null.hierarchy
- Hierarchy object. May be null.public Cluster(String name, DatabaseObjectGroup group, boolean noise, M model, List<Cluster<M>> children, List<Cluster<M>> parents)
name
- Cluster name. May be null.group
- Group datanoise
- Noise flagmodel
- Model. May be null.children
- Children. Will NOT be copied.parents
- Parents. Will NOT be copied.public Cluster(String name, DatabaseObjectGroup group, boolean noise, M model)
name
- group
- noise
- Noise flagmodel
- Modelpublic Cluster(String name, DatabaseObjectGroup group, M model)
name
- group
- model
- Modelpublic Cluster(DatabaseObjectGroup group, boolean noise, M model)
group
- noise
- Noise flagmodel
- Modelpublic Cluster(DatabaseObjectGroup group, M model)
group
- model
- Modelpublic Cluster(String name, DatabaseObjectGroup group, boolean noise)
name
- namegroup
- noise
- Noise flagpublic Cluster(String name, DatabaseObjectGroup group)
name
- group
- public Cluster(DatabaseObjectGroup group, boolean noise)
group
- noise
- Noise flagpublic Cluster(DatabaseObjectGroup group)
group
- public Cluster(String name, DatabaseObjectGroup group, M model, HierarchyImplementation<Cluster<M>> hierarchy)
name
- Cluster name. May be null.group
- Group datamodel
- Model. May be null.hierarchy
- Hierarchy object. May be null.public Cluster(String name, DatabaseObjectGroup group, M model, List<Cluster<M>> children, List<Cluster<M>> parents)
name
- Cluster name. May be null.group
- Group datamodel
- Model. May be null.children
- Children. Will NOT be copied.parents
- Parents. Will NOT be copied.Method Detail |
---|
public final boolean isHierarchical()
isHierarchical
in interface HierarchyInterface<Cluster<M extends Model>>
public int numChildren()
numChildren
in interface HierarchyInterface<Cluster<M extends Model>>
public List<Cluster<M>> getChildren()
getChildren
in interface HierarchyInterface<Cluster<M extends Model>>
public <T extends Collection<Cluster<M>>> T getDescendants(T collection)
getDescendants
in interface HierarchyInterface<Cluster<M extends Model>>
T
- collection typecollection
- Collection to fill
public Set<Cluster<M>> getDescendants()
public int numParents()
numParents
in interface HierarchyInterface<Cluster<M extends Model>>
public List<Cluster<M>> getParents()
getParents
in interface HierarchyInterface<Cluster<M extends Model>>
public <T extends Collection<Cluster<M>>> T getAncestors(T collection)
getAncestors
in interface HierarchyInterface<Cluster<M extends Model>>
T
- collection typecollection
- Collection to fill.
public int size()
size
in interface DatabaseObjectGroup
public Collection<Integer> getIDs()
getIDs
in interface DatabaseObjectGroup
public Iterator<Integer> iterator()
iterator
in interface DatabaseObjectGroup
iterator
in interface Iterable<Integer>
public HierarchyImplementation<Cluster<M>> getHierarchy()
public void setHierarchy(HierarchyImplementation<Cluster<M>> hierarchy)
hierarchy
- new hierarchy objectpublic String getNameAutomatic()
public String getName()
public void setName(String name)
name
- new cluster namepublic DatabaseObjectGroup getGroup()
public void setGroup(DatabaseObjectGroup g)
g
- set database object grouppublic M getModel()
public void setModel(M model)
model
- New cluster modelpublic void writeToText(TextWriterStream out, String label)
writeToText
in interface TextWriteable
out
- output writer streamlabel
- public boolean isNoise()
public void setNoise(boolean noise)
noise
- new noise flag value
|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |