Java tutorial
/* * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ /* * Null.java * Copyright (C) 2009-2012 University of Waikato, Hamilton, New Zealand */ package weka.classifiers.evaluation.output.prediction; import weka.classifiers.Classifier; import weka.core.Instance; /** <!-- globalinfo-start --> * Suppresses all output. * <p/> <!-- globalinfo-end --> * <!-- options-start --> * Valid options are: <p/> * * <pre> -p <range> * The range of attributes to print in addition to the classification. * (default: none)</pre> * * <pre> -distribution * Whether to turn on the output of the class distribution. * Only for nominal class attributes. * (default: off)</pre> * * <pre> -decimals <num> * The number of digits after the decimal point. * (default: 3)</pre> * * <pre> -file <path> * The file to store the output in, instead of outputting it on stdout. * Gets ignored if the supplied path is a directory. * (default: .)</pre> * * <pre> -suppress * In case the data gets stored in a file, then this flag can be used * to suppress the regular output. * (default: not suppressed)</pre> * <!-- options-end --> * * @author fracpete (fracpete at waikato dot ac dot nz) * @version $Revision$ */ public class Null extends AbstractOutput { /** for serialization. */ private static final long serialVersionUID = 4988413155999044966L; /** * Returns a string describing the output generator. * * @return a description suitable for * displaying in the GUI */ public String globalInfo() { return "Suppresses all output."; } /** * Returns a short display text, to be used in comboboxes. * * @return a short display text */ public String getDisplay() { return "No output"; } /** * Returns always false. * * @return always false */ public boolean generatesOutput() { return false; } /** * Does nothing. */ protected void doPrintHeader() { } /** * Does nothing. * * @param classifier the classifier to use * @param inst the instance to generate text from * @param index the index in the dataset * @throws Exception if something goes wrong */ protected void doPrintClassification(Classifier classifier, Instance inst, int index) throws Exception { } /** * Does nothing. * * @param dist the distribution to use * @param inst the instance to generate text from * @param index the index in the dataset * @throws Exception if something goes wrong */ protected void doPrintClassification(double[] dist, Instance inst, int index) throws Exception { } /** * Does nothing. */ protected void doPrintFooter() { } }