# Class DendrogramBuilder

java.lang.Object
ch.usi.inf.sape.hac.dendrogram.DendrogramBuilder

All Implemented Interfaces:
  `ClusteringBuilder`

public final class DendrogramBuilder extends Object implements ClusteringBuilder
A DendrogramBuilder creates a Dendrogram consisting of ObservationNodes and MergeNodes.

## Constructor Summary

Constructors
Constructor
Description
`DendrogramBuilder(int nObservations)`

## Method Summary

Modifier and Type
Method
Description
`final Dendrogram`
`getDendrogram()`
`final void`
`merge(int i, int j, double dissimilarity)`
Merge two clusters.

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### DendrogramBuilder

public DendrogramBuilder(int nObservations)

## Method Details

### merge

public final void merge(int i, int j, double dissimilarity)
Description copied from interface: `ClusteringBuilder`
Merge two clusters.

Specified by:
  `merge` in interface `ClusteringBuilder`
Parameters:
  `i` - the smaller of the two cluster indices
  `j` - the larger of the two cluster indices
  `dissimilarity` - between the two merged clusters

### getDendrogram

public final Dendrogram getDendrogram()