it.unibz.algorithms.types
Class Cluster

java.lang.Object
  extended by it.unibz.algorithms.types.Cluster

public class Cluster
extends java.lang.Object

This class represent a cluster and contains its name, a centroid object, the square sum and the data points


Field Summary
private  Centroid centroid
           
private  java.util.Vector<Instance> Instances
           
private  boolean isnoise
           
private  java.lang.String name
           
 
Constructor Summary
Cluster(java.lang.String name)
          This constructor initializes the classes attributes.
 
Method Summary
 void addAll(java.util.List<Instance> list)
          Adds all instances to the Cluster
 void addInstance(Instance dp)
          The method adds a specific Instance to the Cluster
 void clear()
          Removes all Instances from the Cluster
 boolean contains(Instance p)
          Checks if the Cluster contains a specific Instance
 Centroid getCentroid()
          This method returns the centroid object
 Instance getInstance(int pos)
          This method returns an indexed data point
 java.util.Vector<Instance> getInstances()
          This method returns a vector of Instances
 java.lang.String getName()
          This method returns the Cluster name
 int getNumInstances()
          This method returns the number of Instances
 int getNumOfMinAndMaxXY()
           
 boolean isIsnoise()
          Getter for the isnoise Property
 void removeInstance(Instance dp)
          This method removes the Instance
 void setCentroid(Centroid c)
          This method sets the value of the centroid object
 void setIsnoise(boolean isnoise)
          Setter for the isnoise Property
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

private java.lang.String name

centroid

private Centroid centroid

isnoise

private boolean isnoise

Instances

private java.util.Vector<Instance> Instances
Constructor Detail

Cluster

public Cluster(java.lang.String name)
This constructor initializes the classes attributes. Note: the variable centroid is going to receive a value by calling the method named setCentroid.

Parameters:
name - String
Method Detail

setCentroid

public void setCentroid(Centroid c)
This method sets the value of the centroid object

Parameters:
c - Centroid object

getCentroid

public Centroid getCentroid()
This method returns the centroid object

Returns:
centroid object

addInstance

public void addInstance(Instance dp)
The method adds a specific Instance to the Cluster

Parameters:
dp - Instance object

removeInstance

public void removeInstance(Instance dp)
This method removes the Instance

Parameters:
dp - Instance object

getNumInstances

public int getNumInstances()
This method returns the number of Instances

Returns:
int number of Instances

isIsnoise

public boolean isIsnoise()
Getter for the isnoise Property


setIsnoise

public void setIsnoise(boolean isnoise)
Setter for the isnoise Property


getInstance

public Instance getInstance(int pos)
This method returns an indexed data point

Parameters:
pos - index
Returns:
Instance object

getName

public java.lang.String getName()
This method returns the Cluster name

Returns:
String cluster name

getInstances

public java.util.Vector<Instance> getInstances()
This method returns a vector of Instances

Returns:
Vector of Instances

clear

public void clear()
Removes all Instances from the Cluster


addAll

public void addAll(java.util.List<Instance> list)
Adds all instances to the Cluster

Parameters:
tmpLst - Instances to add

contains

public boolean contains(Instance p)
Checks if the Cluster contains a specific Instance

Parameters:
p - The instance to check
Returns:
True if contained

getNumOfMinAndMaxXY

public int getNumOfMinAndMaxXY()