public void setNumberOfClusters(int numberOfClusters) throws Exception { if (wekaClusterer instanceof NumberOfClustersRequestable) { ((NumberOfClustersRequestable) wekaClusterer).setNumClusters(numberOfClusters); } else { throw new RuntimeException("Cannot set number of Clusters for this Clusterer"); } }
/** * Set the number of clusters to generate. * * @param n the number of clusters to generate * @throws Exception if the wrapped clusterer has not been set, or if the * wrapped clusterer does not implement this facility. */ @Override public void setNumClusters(int n) throws Exception { if (m_wrappedClusterer == null) { throw new Exception("Can't set the number of clusters to generate - " + "no clusterer has been set yet."); } if (!(m_wrappedClusterer instanceof NumberOfClustersRequestable)) { throw new Exception("Can't set the number of clusters to generate - " + "wrapped clusterer does not support this facility."); } ((NumberOfClustersRequestable) m_wrappedClusterer).setNumClusters(n); }
/** * Set the number of clusters to generate. * * @param n the number of clusters to generate * @throws Exception if the wrapped clusterer has not been set, or if the * wrapped clusterer does not implement this facility. */ @Override public void setNumClusters(int n) throws Exception { if (m_wrappedClusterer == null) { throw new Exception("Can't set the number of clusters to generate - " + "no clusterer has been set yet."); } if (!(m_wrappedClusterer instanceof NumberOfClustersRequestable)) { throw new Exception("Can't set the number of clusters to generate - " + "wrapped clusterer does not support this facility."); } ((NumberOfClustersRequestable) m_wrappedClusterer).setNumClusters(n); }