info.aduna.clustermap
Class DefaultCluster

java.lang.Object
  extended by info.aduna.clustermap.DefaultCluster
All Implemented Interfaces:
Cluster

public class DefaultCluster
extends Object
implements Cluster

DefaultCluster provides a reasonable default implementation of Cluster.


Constructor Summary
DefaultCluster(Collection<? extends Classification> classifications)
          Creates an empty DefaultCluster that represents the specified set of Classifications.
DefaultCluster(Collection<? extends Classification> classifications, Collection<?> objects)
          Creates a DefaultCluster that represent the specified set of Classifications and that contains the specified set of Objects.
 
Method Summary
 void add(Object object)
           
 boolean contains(Object object)
          Returns whether this Cluster contains the specified Object.
 Collection<? extends Classification> getClassifications()
          Returns the set of Classifications represented by this Cluster.
 Collection<? extends Classification> getMostSpecificClassifications()
          Returns the set of most specific Classifications represented by this Cluster.
 Collection<?> getObjects()
          Returns the set of Objects contained in this Cluster.
 int getSize()
          Returns the number of Objects contained in this Cluster.
 void setObjects(Collection<?> objects)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultCluster

public DefaultCluster(Collection<? extends Classification> classifications)
Creates an empty DefaultCluster that represents the specified set of Classifications.


DefaultCluster

public DefaultCluster(Collection<? extends Classification> classifications,
                      Collection<?> objects)
Creates a DefaultCluster that represent the specified set of Classifications and that contains the specified set of Objects.

Method Detail

getClassifications

public Collection<? extends Classification> getClassifications()
Description copied from interface: Cluster
Returns the set of Classifications represented by this Cluster.

Specified by:
getClassifications in interface Cluster

getMostSpecificClassifications

public Collection<? extends Classification> getMostSpecificClassifications()
Description copied from interface: Cluster
Returns the set of most specific Classifications represented by this Cluster. This equals the entire set of Classifications minus those Classifications that also have a direct or indirect subclass present in the set.

Specified by:
getMostSpecificClassifications in interface Cluster

getObjects

public Collection<?> getObjects()
Description copied from interface: Cluster
Returns the set of Objects contained in this Cluster.

Specified by:
getObjects in interface Cluster

getSize

public int getSize()
Description copied from interface: Cluster
Returns the number of Objects contained in this Cluster.

Specified by:
getSize in interface Cluster

contains

public boolean contains(Object object)
Description copied from interface: Cluster
Returns whether this Cluster contains the specified Object.

Specified by:
contains in interface Cluster

setObjects

public void setObjects(Collection<?> objects)

add

public void add(Object object)


Copyright © 1997-2008 Aduna. All Rights Reserved.