Option.java
Upload User: rhdiban
Upload Date: 2013-08-09
Package Size: 15085k
Code Size: 2k
Category:

Windows Develop

Development Platform:

Java

  1. /*
  2.  *    This program is free software; you can redistribute it and/or modify
  3.  *    it under the terms of the GNU General Public License as published by
  4.  *    the Free Software Foundation; either version 2 of the License, or
  5.  *    (at your option) any later version.
  6.  *
  7.  *    This program is distributed in the hope that it will be useful,
  8.  *    but WITHOUT ANY WARRANTY; without even the implied warranty of
  9.  *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  10.  *    GNU General Public License for more details.
  11.  *
  12.  *    You should have received a copy of the GNU General Public License
  13.  *    along with this program; if not, write to the Free Software
  14.  *    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  15.  */
  16. /*
  17.  *    Option.java
  18.  *    Copyright (C) 1999 Eibe Frank
  19.  *
  20.  */
  21. package weka.core;
  22. /** 
  23.  * Class to store information about an option. <p>
  24.  *
  25.  * Typical usage: <p>
  26.  *
  27.  * <code>Option myOption = new Option("Uses extended mode.", "E", 0, "-E")); </code><p>
  28.  *
  29.  * @author Eibe Frank (eibe@cs.waikato.ac.nz)
  30.  * @version $Revision: 1.5 $
  31.  */
  32. public class Option {
  33.   /** What does this option do? */
  34.   private String m_Description;
  35.   /** The synopsis. */
  36.   private String m_Synopsis;
  37.   /** What's the option's name? */
  38.   private String m_Name;
  39.   /** How many arguments does it take? */
  40.   private int m_NumArguments;
  41.   /**
  42.    * Creates new option with the given parameters.
  43.    *
  44.    * @param description the option's description
  45.    * @param name the option's name
  46.    * @param numArguments the number of arguments
  47.    */
  48.   public Option(String description, String name, 
  49. int numArguments, String synopsis) {
  50.   
  51.     m_Description = description;
  52.     m_Name = name;
  53.     m_NumArguments = numArguments;
  54.     m_Synopsis = synopsis;
  55.   }
  56.   /**
  57.    * Returns the option's description.
  58.    *
  59.    * @return the option's description
  60.    */
  61.   public String description() {
  62.   
  63.     return m_Description;
  64.   }
  65.   /**
  66.    * Returns the option's name.
  67.    *
  68.    * @return the option's name
  69.    */
  70.   public String name() {
  71.     return m_Name;
  72.   }
  73.   /**
  74.    * Returns the option's number of arguments.
  75.    *
  76.    * @return the option's number of arguments
  77.    */
  78.   public int numArguments() {
  79.   
  80.     return m_NumArguments;
  81.   }
  82.   /**
  83.    * Returns the option's synopsis.
  84.    *
  85.    * @return the option's synopsis
  86.    */
  87.   public String synopsis() {
  88.   
  89.     return m_Synopsis;
  90.   }
  91. }