001 package org.hackystat.projectbrowser.page.projectportfolio.detailspanel.chart; 002 003 import org.apache.wicket.markup.html.panel.Panel; 004 import org.hackystat.projectbrowser.page.projectportfolio.jaxb.Measures.Measure; 005 006 /** 007 * Interface of stream classifier. 008 * 009 * @author Shaoxuan Zhang 010 * 011 */ 012 public interface StreamClassifier { 013 014 /** 015 * Parse the given MiniBarChart and produce a {@link PortfolioCategory} result. 016 * @param chart the input chart 017 * @return StreamCategory enumeration. 018 */ 019 public PortfolioCategory getStreamCategory(MiniBarChart chart); 020 021 /** 022 * Return the panel for users to configure this classifier. 023 * @param id The Wicket component id. 024 * @return a Panel 025 */ 026 public Panel getConfigurationPanel(String id); 027 028 /** 029 * Parse the given value and produce a {@link PortfolioCategory} result. 030 * @param value a double value. 031 * @return a {@link PortfolioCategory}. 032 */ 033 public PortfolioCategory getValueCategory(double value); 034 035 /** 036 * @return the name of this classifier. 037 */ 038 public String getName(); 039 040 041 /** 042 * Save classifier's setting into the given {@link Measure} instance. 043 * @param measure the given {@link Measure} instance 044 */ 045 public void saveSetting(Measure measure); 046 }